Skip to content

Commit

Permalink
fix: add docgroups to watchFragment options
Browse files Browse the repository at this point in the history
  • Loading branch information
alessbell committed Mar 18, 2024
1 parent d243a38 commit 88cc319
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/cache/core/cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,32 +31,42 @@ export type Transaction<T> = (c: ApolloCache<T>) => void;
*/
export interface WatchFragmentOptions<TData, TVars> {
/**
* **Required.** A GraphQL fragment document parsed into an AST with the `gql`
* A GraphQL fragment document parsed into an AST with the `gql`
* template literal.
*
* @docGroup 1. Required options
*/
fragment: DocumentNode | TypedDocumentNode<TData, TVars>;
/**
* **Required.** An object containing a `__typename` and primary key fields
* An object containing a `__typename` and primary key fields
* (such as `id`) identifying the entity object from which the fragment will
* be retrieved, or a `{ __ref: "..." }` reference, or a `string` ID
* (uncommon).
*
* @docGroup 1. Required options
*/
from: StoreObject | Reference | string;
/**
* Any variables that the GraphQL fragment may depend on.
*
* @docGroup 2. Cache options
*/
variables?: TVars;
/**
* The name of the fragment defined in the fragment document.
*
* **Required** if the fragment document includes more than one fragment,
* Required if the fragment document includes more than one fragment,
* optional otherwise.
*
* @docGroup 2. Cache options
*/
fragmentName?: string;
/**
* If `true`, `watchFragment` returns optimistic results.
*
* The default value is `true`.
*
* @docGroup 2. Cache options
*/
optimistic?: boolean;
/**
Expand Down

0 comments on commit 88cc319

Please sign in to comment.