Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitff8e80d

Browse files
captbaritonefacebook-github-bot
authored andcommitted
Update docs to clarify behavior of refetchable variables with nullable fragment reference
Differential Revision: D57056715fbshipit-source-id: 0f2f559e49a812d31070aa661fb76324d28df0af
1 parentcd9246e commitff8e80d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

‎website/docs/api-reference/hooks/use-refetchable-fragment.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,9 @@ Tuple containing the following values
9090
* Arguments:
9191
*`variables`: Object containing the new set of variable values to be used to fetch the`@refetchable` query.
9292
* These variables need to match GraphQL variables referenced inside the fragment.
93-
* However, only the variables that are intended to change for the refetch request need to be specified; any variables referenced by the fragment that are omitted from this input will fall back to using the value specified in the original parent query. So for example, to refetch the fragment with the exact same variables as it was originally fetched, you can call`refetch({})`.
94-
* Similarly, passing an`id` value for the`$id` variable is _*optional*_, unless the fragment wants to be refetched with a different`id`. When refetching a`@refetchable` fragment, Relay will already know the id of the rendered object.
93+
* If the fragment key passed to`useRefetchableFragment` is optional then all non-optional variables must be passed including, potentially, the object's ID since Relay may not have any existing variables to reuse.
94+
* If the fragment key is non-optional, only the variables that are intended to change for the refetch request need to be specified; any variables referenced by the fragment that are omitted from this input will fall back to using the value specified in the original parent query. So for example, to refetch the fragment with the exact same variables as it was originally fetched, you can call`refetch({})`.
95+
* Similarly, if the fragment key is non-optional, passing an`id` value for the`$id` variable is _*optional*_, unless the fragment wants to be refetched with a different`id`. When refetching a non-nullable`@refetchable` fragment, Relay will already know the id of the rendered object.
9596
*`options`: *_[Optional]_* options object
9697
*`fetchPolicy`: Determines if cached data should be used, and when to send a network request based on cached data that is available. See the [Fetch Policies](../../guided-tour/reusing-cached-data/fetch-policies/) section for full specification.
9798
*`onComplete`: Function that will be called whenever the refetch request has completed, including any incremental data payloads.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp