import type { DataState, ErrorLike, GetDataState, NetworkStatus } from "@apollo/client"; import type { MaybeMasked } from "@apollo/client/masking"; import type { QueryRef } from "@apollo/client/react"; import type { DocumentationTypes as UtilityDocumentationTypes } from "@apollo/client/utilities/internal"; export declare namespace useReadQuery { namespace Base { interface Result { /** * A single ErrorLike object describing the error that occurred during the latest * query execution. * * For more information, see [Handling operation errors](https://www.apollographql.com/docs/react/data/error-handling/). * * @docGroup 1. Operation data * * * This property can be ignored when using the default `errorPolicy` or an * `errorPolicy` of `none`. The hook will throw the error instead of setting * this property. */ error: ErrorLike | undefined; /** * A number indicating the current network state of the query's associated request. [See possible values.](https://github.com/apollographql/apollo-client/blob/d96f4578f89b933c281bb775a39503f6cdb59ee8/src/core/networkStatus.ts#L4) * * Used in conjunction with the [`notifyOnNetworkStatusChange`](#notifyonnetworkstatuschange) option. * * @docGroup 2. Network info */ networkStatus: NetworkStatus; } } type Result["dataState"] = DataState["dataState"]> = Base.Result & GetDataState, TStates>; namespace DocumentationTypes { namespace useReadQuery { interface Result extends Base.Result, UtilityDocumentationTypes.DataState { } } /** * For a detailed explanation of `useReadQuery`, see the [fetching with Suspense reference](https://www.apollographql.com/docs/react/data/suspense#avoiding-request-waterfalls). * * @param queryRef - The `QueryRef` that was generated via `useBackgroundQuery`. * @returns An object containing the query result data, error, and network status. * * @example * * ```jsx * import { Suspense } from "react"; * import { useBackgroundQuery, useReadQuery } from "@apollo/client"; * * function Parent() { * const [queryRef] = useBackgroundQuery(query); * * return ( * Loading...}> * * * ); * } * * function Child({ queryRef }) { * const { data } = useReadQuery(queryRef); * * return
{data.name}
; * } * ``` */ function useReadQuery(queryRef: QueryRef): useReadQuery.Result; } } /** * For a detailed explanation of `useReadQuery`, see the [fetching with Suspense reference](https://www.apollographql.com/docs/react/data/suspense#avoiding-request-waterfalls). * * @param queryRef - The `QueryRef` that was generated via `useBackgroundQuery`. * @returns An object containing the query result data, error, and network status. * * @example * * ```jsx * import { Suspense } from "react"; * import { useBackgroundQuery, useReadQuery } from "@apollo/client"; * * function Parent() { * const [queryRef] = useBackgroundQuery(query); * * return ( * Loading...}> * * * ); * } * * function Child({ queryRef }) { * const { data } = useReadQuery(queryRef); * * return
{data.name}
; * } * ``` */ export declare function useReadQuery["dataState"]>(queryRef: QueryRef): useReadQuery.Result; //# sourceMappingURL=useReadQuery.d.ts.map