From dbae5cd5350b76f21ce5f9ff20b2278818221695 Mon Sep 17 00:00:00 2001 From: Danny Zou Date: Tue, 18 Jun 2024 12:26:28 -0700 Subject: [PATCH] Link GQL node definition in useRefetchableFragment section Reviewed By: captbaritone Differential Revision: D58737914 fbshipit-source-id: e21ad6131bc89ae2ebe788bc1188608b891b4222 --- website/docs/api-reference/hooks/use-refetchable-fragment.md | 2 +- .../api-reference/hooks/use-refetchable-fragment.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/website/docs/api-reference/hooks/use-refetchable-fragment.md b/website/docs/api-reference/hooks/use-refetchable-fragment.md index 94ae6aea9daf6..8b195431e7e93 100644 --- a/website/docs/api-reference/hooks/use-refetchable-fragment.md +++ b/website/docs/api-reference/hooks/use-refetchable-fragment.md @@ -69,7 +69,7 @@ module.exports = CommentBody; ### Arguments -* `fragment`: GraphQL fragment specified using a `graphql` template literal. This fragment must have a `@refetchable` directive, otherwise using it will throw an error. The `@refetchable` directive can only be added to fragments that are "refetchable", that is, on fragments that are declared on `Viewer` or `Query` types, or on a type that implements `Node` (i.e. a type that has an `id`). +* `fragment`: GraphQL fragment specified using a `graphql` template literal. This fragment must have a `@refetchable` directive, otherwise using it will throw an error. The `@refetchable` directive can only be added to fragments that are "refetchable", that is, on fragments that are declared on `Viewer` or `Query` types, or on a type that implements `Node` (i.e. a type that has an `id` and has the capability to be queryed by its `id` field. See [graphql server specification section](../../guides/graphql-server-specification) for more details). * Note that you *do not* need to manually specify a refetch query yourself. The `@refetchable` directive will autogenerate a query with the specified `queryName`. This will also generate Flow types for the query, available to import from the generated file: `.graphql.js`. * `fragmentReference`: The *fragment reference* is an opaque Relay object that Relay uses to read the data for the fragment from the store; more specifically, it contains information about which particular object instance the data should be read from. * The type of the fragment reference can be imported from the generated Flow types, from the file `.graphql.js`, and can be used to declare the type of your `Props`. The name of the fragment reference type will be: `$key`. We use our [lint rule](https://github.com/relayjs/eslint-plugin-relay) to enforce that the type of the fragment reference prop is correctly declared. diff --git a/website/versioned_docs/version-v17.0.0/api-reference/hooks/use-refetchable-fragment.md b/website/versioned_docs/version-v17.0.0/api-reference/hooks/use-refetchable-fragment.md index 94ae6aea9daf6..8b195431e7e93 100644 --- a/website/versioned_docs/version-v17.0.0/api-reference/hooks/use-refetchable-fragment.md +++ b/website/versioned_docs/version-v17.0.0/api-reference/hooks/use-refetchable-fragment.md @@ -69,7 +69,7 @@ module.exports = CommentBody; ### Arguments -* `fragment`: GraphQL fragment specified using a `graphql` template literal. This fragment must have a `@refetchable` directive, otherwise using it will throw an error. The `@refetchable` directive can only be added to fragments that are "refetchable", that is, on fragments that are declared on `Viewer` or `Query` types, or on a type that implements `Node` (i.e. a type that has an `id`). +* `fragment`: GraphQL fragment specified using a `graphql` template literal. This fragment must have a `@refetchable` directive, otherwise using it will throw an error. The `@refetchable` directive can only be added to fragments that are "refetchable", that is, on fragments that are declared on `Viewer` or `Query` types, or on a type that implements `Node` (i.e. a type that has an `id` and has the capability to be queryed by its `id` field. See [graphql server specification section](../../guides/graphql-server-specification) for more details). * Note that you *do not* need to manually specify a refetch query yourself. The `@refetchable` directive will autogenerate a query with the specified `queryName`. This will also generate Flow types for the query, available to import from the generated file: `.graphql.js`. * `fragmentReference`: The *fragment reference* is an opaque Relay object that Relay uses to read the data for the fragment from the store; more specifically, it contains information about which particular object instance the data should be read from. * The type of the fragment reference can be imported from the generated Flow types, from the file `.graphql.js`, and can be used to declare the type of your `Props`. The name of the fragment reference type will be: `$key`. We use our [lint rule](https://github.com/relayjs/eslint-plugin-relay) to enforce that the type of the fragment reference prop is correctly declared.