import type { Query } from "../run-query.js"; /** * A hook that runs a GraphQL query and returns the result. * * Your component will suspend until the query completes. * * If you import the query from a `.graphql` file and run `attio dev`, your query variables and * your query result will be strongly typed. * * @param query The GraphQL query to run. * @param variableValues The variables to pass to the query. * @returns The result of the query. * * @example * * ```graphql * # get-person.graphql * query getPerson($id: String!) { * workspace { * person(id: $id) { * name { * first * last * } * } * } * } * ``` * ```tsx * // Component.tsx * import {useQuery, useRecord} from "attio/client" * import getPersonQuery from "./get-person.graphql.js" * * // ... * * // In component: * const {recordId} = useRecord() * const result = useQuery(getPersonQuery, {id: recordId}) * * const firstName: string | null = result.workspace?.person?.name?.first * const lastName: string | null = result.workspace?.person?.name?.last * ``` */ export declare function useQuery | never, Result>(query: Query, variableValues?: Variables extends never ? never : Variables): Result; //# sourceMappingURL=use-query.d.ts.map