UNPKG

1.34 kBTypeScriptView Raw
1import type { QueryRef } from "../internal/index.js";
2import type { ApolloError } from "../../errors/index.js";
3import type { NetworkStatus } from "../../core/index.js";
4export interface UseReadQueryResult<TData = unknown> {
5 /**
6 * An object containing the result of your GraphQL query after it completes.
7 *
8 * This value might be `undefined` if a query results in one or more errors
9 * (depending on the query's `errorPolicy`).
10 */
11 data: TData;
12 /**
13 * If the query produces one or more errors, this object contains either an
14 * array of `graphQLErrors` or a single `networkError`. Otherwise, this value
15 * is `undefined`.
16 *
17 * This property can be ignored when using the default `errorPolicy` or an
18 * `errorPolicy` of `none`. The hook will throw the error instead of setting
19 * this property.
20 */
21 error: ApolloError | undefined;
22 /**
23 * A number indicating the current network state of the query's associated
24 * request. {@link https://github.com/apollographql/apollo-client/blob/d96f4578f89b933c281bb775a39503f6cdb59ee8/src/core/networkStatus.ts#L4 | See possible values}.
25 */
26 networkStatus: NetworkStatus;
27}
28export declare function useReadQuery<TData>(queryRef: QueryRef<TData>): UseReadQueryResult<TData>;
29//# sourceMappingURL=useReadQuery.d.ts.map
\No newline at end of file