From 85b1b801232f5ddb1f699a274cc8a2b358af08d7 Mon Sep 17 00:00:00 2001 From: Jerel Miller Date: Mon, 16 Oct 2023 17:32:59 -0600 Subject: [PATCH] Add typedoc comments to UseReadQueryResult type --- src/react/hooks/useReadQuery.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/react/hooks/useReadQuery.ts b/src/react/hooks/useReadQuery.ts index 2a711fa165e..e6a97e1446f 100644 --- a/src/react/hooks/useReadQuery.ts +++ b/src/react/hooks/useReadQuery.ts @@ -9,8 +9,27 @@ import type { ApolloError } from "../../errors/index.js"; import type { NetworkStatus } from "../../core/index.js"; export interface UseReadQueryResult { + /** + * An object containing the result of your GraphQL query after it completes. + * + * This value might be `undefined` if a query results in one or more errors + * (depending on the query's `errorPolicy`). + */ data: TData; + /** + * If the query produces one or more errors, this object contains either an + * array of `graphQLErrors` or a single `networkError`. Otherwise, this value + * is `undefined`. + * + * 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: ApolloError | undefined; + /** + * A number indicating the current network state of the query's associated + * request. {@link https://github.com/apollographql/apollo-client/blob/d96f4578f89b933c281bb775a39503f6cdb59ee8/src/core/networkStatus.ts#L4 | See possible values}. + */ networkStatus: NetworkStatus; }