You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: website/docs/api-reference/hooks/use-refetchable-fragment.md
+3-2Lines changed: 3 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -90,8 +90,9 @@ Tuple containing the following values
90
90
* Arguments:
91
91
*`variables`: Object containing the new set of variable values to be used to fetch the`@refetchable` query.
92
92
* 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.
95
96
*`options`: *_[Optional]_* options object
96
97
*`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.
97
98
*`onComplete`: Function that will be called whenever the refetch request has completed, including any incremental data payloads.