relay-runtime 20.1.0 → 21.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (262) hide show
  1. package/experimental.js +1 -1
  2. package/experimental.js.flow +8 -8
  3. package/handlers/connection/ConnectionHandler.js.flow +5 -5
  4. package/handlers/connection/ConnectionInterface.js.flow +1 -1
  5. package/index.js +1 -1
  6. package/index.js.flow +125 -62
  7. package/lib/experimental.js +3 -3
  8. package/lib/index.js +105 -57
  9. package/lib/multi-actor-environment/ActorIdentifier.js +2 -2
  10. package/lib/multi-actor-environment/MultiActorEnvironment.js +3 -1
  11. package/lib/mutations/commitMutation.js +8 -8
  12. package/lib/mutations/validateMutation.js +4 -4
  13. package/lib/query/GraphQLTag.js +3 -3
  14. package/lib/query/fetchQuery.js +15 -3
  15. package/lib/store/DataChecker.js +38 -4
  16. package/lib/store/NormalizationEngine.js +373 -0
  17. package/lib/store/OperationExecutor.js +172 -113
  18. package/lib/store/RelayConcreteVariables.js +1 -1
  19. package/lib/store/RelayErrorTrie.js +2 -2
  20. package/lib/store/RelayExperimentalGraphResponseTransform.js +8 -8
  21. package/lib/store/RelayModernEnvironment.js +26 -19
  22. package/lib/store/RelayModernRecord.js +18 -8
  23. package/lib/store/RelayModernSelector.js +9 -9
  24. package/lib/store/RelayModernStore.js +152 -43
  25. package/lib/store/RelayPublishQueue.js +1 -1
  26. package/lib/store/RelayReader.js +76 -38
  27. package/lib/store/RelayRecordSource.js +6 -0
  28. package/lib/store/RelayReferenceMarker.js +2 -1
  29. package/lib/store/RelayResponseNormalizer.js +88 -55
  30. package/lib/store/RelayStoreSubscriptions.js +34 -10
  31. package/lib/store/RelayStoreUtils.js +8 -1
  32. package/lib/store/ResolverFragments.js +2 -2
  33. package/lib/store/live-resolvers/LiveResolverCache.js +25 -9
  34. package/lib/store/observeFragmentExperimental.js +17 -1
  35. package/lib/store/observeQueryExperimental.js +2 -2
  36. package/lib/subscription/requestSubscription.js +3 -3
  37. package/lib/util/RelayError.js +3 -0
  38. package/lib/util/RelayFeatureFlags.js +6 -2
  39. package/lib/util/RelayReplaySubject.js +4 -4
  40. package/lib/util/handlePotentialSnapshotErrors.js +2 -2
  41. package/lib/util/stableCopy.js +2 -2
  42. package/llm-docs/api-reference/entrypoint-apis/entrypoint-container.mdx +38 -0
  43. package/llm-docs/api-reference/entrypoint-apis/load-entrypoint.mdx +77 -0
  44. package/llm-docs/api-reference/entrypoint-apis/use-entrypoint-loader.mdx +99 -0
  45. package/llm-docs/api-reference/graphql/graphql-directives.mdx +378 -0
  46. package/llm-docs/api-reference/hooks/_use-lazy-load-query-extra.mdx +16 -0
  47. package/llm-docs/api-reference/hooks/load-query.mdx +84 -0
  48. package/llm-docs/api-reference/hooks/relay-environment-provider.mdx +78 -0
  49. package/llm-docs/api-reference/hooks/use-client-query.mdx +65 -0
  50. package/llm-docs/api-reference/hooks/use-fragment.mdx +69 -0
  51. package/llm-docs/api-reference/hooks/use-lazy-load-query.mdx +62 -0
  52. package/llm-docs/api-reference/hooks/use-mutation.mdx +94 -0
  53. package/llm-docs/api-reference/hooks/use-pagination-fragment.mdx +166 -0
  54. package/llm-docs/api-reference/hooks/use-prefetchable-forward-pagination-fragment.mdx +134 -0
  55. package/llm-docs/api-reference/hooks/use-preloaded-query.mdx +84 -0
  56. package/llm-docs/api-reference/hooks/use-query-loader.mdx +95 -0
  57. package/llm-docs/api-reference/hooks/use-refetchable-fragment.mdx +122 -0
  58. package/llm-docs/api-reference/hooks/use-relay-environment.mdx +37 -0
  59. package/llm-docs/api-reference/hooks/use-subscription.mdx +66 -0
  60. package/llm-docs/api-reference/relay-resolvers/docblock-format.mdx +321 -0
  61. package/llm-docs/api-reference/relay-resolvers/runtime-functions.mdx +94 -0
  62. package/llm-docs/api-reference/relay-runtime/commit-mutation.mdx +65 -0
  63. package/llm-docs/api-reference/relay-runtime/fetch-query.mdx +113 -0
  64. package/llm-docs/api-reference/relay-runtime/field-logger.mdx +170 -0
  65. package/llm-docs/api-reference/relay-runtime/observe-fragment.mdx +92 -0
  66. package/llm-docs/api-reference/relay-runtime/relay-environment.mdx +53 -0
  67. package/llm-docs/api-reference/relay-runtime/request-subscription.mdx +54 -0
  68. package/llm-docs/api-reference/relay-runtime/runtime-configuration.mdx +52 -0
  69. package/llm-docs/api-reference/relay-runtime/store.mdx +734 -0
  70. package/llm-docs/api-reference/relay-runtime/wait-for-fragment-data.mdx +89 -0
  71. package/llm-docs/api-reference/types/CacheConfig.mdx +8 -0
  72. package/llm-docs/api-reference/types/Disposable.mdx +4 -0
  73. package/llm-docs/api-reference/types/GraphQLSubscriptionConfig.mdx +17 -0
  74. package/llm-docs/api-reference/types/MutationConfig.mdx +31 -0
  75. package/llm-docs/api-reference/types/SelectorStoreUpdater.mdx +6 -0
  76. package/llm-docs/api-reference/types/UploadableMap.mdx +3 -0
  77. package/llm-docs/community/learning-resources.mdx +64 -0
  78. package/llm-docs/debugging/declarative-mutation-directives.mdx +34 -0
  79. package/llm-docs/debugging/disallowed-id-types-error.mdx +43 -0
  80. package/llm-docs/debugging/inconsistent-typename-error.mdx +47 -0
  81. package/llm-docs/debugging/relay-devtools.mdx +73 -0
  82. package/llm-docs/debugging/why-null.mdx +116 -0
  83. package/llm-docs/editor-support.mdx +55 -0
  84. package/llm-docs/error-reference/unknown-field.mdx +36 -0
  85. package/llm-docs/getting-started/babel-plugin.mdx +31 -0
  86. package/llm-docs/getting-started/compiler-config.mdx +25 -0
  87. package/llm-docs/getting-started/compiler.mdx +82 -0
  88. package/llm-docs/getting-started/lint-rules.mdx +87 -0
  89. package/llm-docs/getting-started/production.mdx +30 -0
  90. package/llm-docs/getting-started/quick-start.mdx +213 -0
  91. package/llm-docs/glossary/glossary.mdx +1040 -0
  92. package/llm-docs/guided-tour/list-data/advanced-pagination.mdx +157 -0
  93. package/llm-docs/guided-tour/list-data/connections.mdx +81 -0
  94. package/llm-docs/guided-tour/list-data/pagination.mdx +193 -0
  95. package/llm-docs/guided-tour/list-data/rendering-connections.mdx +112 -0
  96. package/llm-docs/guided-tour/list-data/streaming-pagination.mdx +87 -0
  97. package/llm-docs/guided-tour/managing-data-outside-react/retaining-queries.mdx +51 -0
  98. package/llm-docs/guided-tour/refetching/refetching-queries-with-different-data.mdx +337 -0
  99. package/llm-docs/guided-tour/refetching/refreshing-queries.mdx +350 -0
  100. package/llm-docs/guided-tour/rendering/environment.mdx +59 -0
  101. package/llm-docs/guided-tour/rendering/error-states.mdx +295 -0
  102. package/llm-docs/guided-tour/rendering/fragments.mdx +354 -0
  103. package/llm-docs/guided-tour/rendering/loading-states.mdx +245 -0
  104. package/llm-docs/guided-tour/rendering/queries.mdx +261 -0
  105. package/llm-docs/guided-tour/rendering/variables.mdx +233 -0
  106. package/llm-docs/guided-tour/reusing-cached-data/fetch-policies.mdx +56 -0
  107. package/llm-docs/guided-tour/reusing-cached-data/filling-in-missing-data.mdx +102 -0
  108. package/llm-docs/guided-tour/reusing-cached-data/introduction.mdx +22 -0
  109. package/llm-docs/guided-tour/reusing-cached-data/presence-of-data.mdx +93 -0
  110. package/llm-docs/guided-tour/reusing-cached-data/rendering-partially-cached-data.mdx +175 -0
  111. package/llm-docs/guided-tour/reusing-cached-data/staleness-of-data.mdx +116 -0
  112. package/llm-docs/guided-tour/updating-data/client-only-data.mdx +115 -0
  113. package/llm-docs/guided-tour/updating-data/graphql-mutations.mdx +334 -0
  114. package/llm-docs/guided-tour/updating-data/graphql-subscriptions.mdx +279 -0
  115. package/llm-docs/guided-tour/updating-data/imperatively-modifying-linked-fields.mdx +511 -0
  116. package/llm-docs/guided-tour/updating-data/imperatively-modifying-store-data-legacy.mdx +142 -0
  117. package/llm-docs/guided-tour/updating-data/imperatively-modifying-store-data.mdx +275 -0
  118. package/llm-docs/guided-tour/updating-data/introduction.mdx +25 -0
  119. package/llm-docs/guided-tour/updating-data/local-data-updates.mdx +71 -0
  120. package/llm-docs/guided-tour/updating-data/typesafe-updaters-faq.mdx +83 -0
  121. package/llm-docs/guided-tour/updating-data/updating-connections.mdx +592 -0
  122. package/llm-docs/guides/alias-directive.mdx +160 -0
  123. package/llm-docs/guides/catch-directive.mdx +167 -0
  124. package/llm-docs/guides/client-schema-extensions.mdx +208 -0
  125. package/llm-docs/guides/codemods.mdx +66 -0
  126. package/llm-docs/guides/data-driven-dependencies/client-3d.mdx +255 -0
  127. package/llm-docs/guides/data-driven-dependencies/configuration.mdx +127 -0
  128. package/llm-docs/guides/data-driven-dependencies/introduction.mdx +39 -0
  129. package/llm-docs/guides/data-driven-dependencies/server-3d.mdx +664 -0
  130. package/llm-docs/guides/document-comparison.mdx +106 -0
  131. package/llm-docs/guides/graphql-server-specification.mdx +453 -0
  132. package/llm-docs/guides/network-layer.mdx +69 -0
  133. package/llm-docs/guides/persisted-queries.mdx +328 -0
  134. package/llm-docs/guides/relay-resolvers/context.mdx +99 -0
  135. package/llm-docs/guides/relay-resolvers/defining-fields.mdx +151 -0
  136. package/llm-docs/guides/relay-resolvers/defining-types.mdx +164 -0
  137. package/llm-docs/guides/relay-resolvers/deprecated.mdx +27 -0
  138. package/llm-docs/guides/relay-resolvers/derived-fields.mdx +127 -0
  139. package/llm-docs/guides/relay-resolvers/descriptions.mdx +44 -0
  140. package/llm-docs/guides/relay-resolvers/enabling.mdx +41 -0
  141. package/llm-docs/guides/relay-resolvers/errors.mdx +64 -0
  142. package/llm-docs/guides/relay-resolvers/field-arguments.mdx +63 -0
  143. package/llm-docs/guides/relay-resolvers/introduction.mdx +62 -0
  144. package/llm-docs/guides/relay-resolvers/limitations.mdx +30 -0
  145. package/llm-docs/guides/relay-resolvers/live-fields.mdx +164 -0
  146. package/llm-docs/guides/relay-resolvers/return-types.mdx +161 -0
  147. package/llm-docs/guides/relay-resolvers/suspense.mdx +41 -0
  148. package/llm-docs/guides/required-directive.mdx +240 -0
  149. package/llm-docs/guides/semantic-nullability.mdx +93 -0
  150. package/llm-docs/guides/testing-relay-components.mdx +642 -0
  151. package/llm-docs/guides/testing-relay-with-preloaded-queries.mdx +160 -0
  152. package/llm-docs/guides/throw-on-field-error-directive.mdx +58 -0
  153. package/llm-docs/guides/type-emission.mdx +414 -0
  154. package/llm-docs/home.mdx +32 -0
  155. package/llm-docs/principles-and-architecture/architecture-overview.mdx +24 -0
  156. package/llm-docs/principles-and-architecture/compiler-architecture.mdx +106 -0
  157. package/llm-docs/principles-and-architecture/runtime-architecture.mdx +249 -0
  158. package/llm-docs/principles-and-architecture/thinking-in-graphql.mdx +309 -0
  159. package/llm-docs/principles-and-architecture/thinking-in-relay.mdx +104 -0
  160. package/llm-docs/principles-and-architecture/videos.mdx +50 -0
  161. package/llm-docs/tutorial/arrays-lists.mdx +126 -0
  162. package/llm-docs/tutorial/fragments-1.mdx +487 -0
  163. package/llm-docs/tutorial/graphql.mdx +172 -0
  164. package/llm-docs/tutorial/interfaces-polymorphism.mdx +161 -0
  165. package/llm-docs/tutorial/intro.mdx +58 -0
  166. package/llm-docs/tutorial/mutations-updates.mdx +624 -0
  167. package/llm-docs/tutorial/organizing-mutations-queries-and-subscriptions.mdx +13 -0
  168. package/llm-docs/tutorial/queries-1.mdx +267 -0
  169. package/llm-docs/tutorial/queries-2.mdx +389 -0
  170. package/llm-docs/tutorial/refetchable-fragments.mdx +352 -0
  171. package/multi-actor-environment/ActorIdentifier.js.flow +2 -2
  172. package/multi-actor-environment/ActorSpecificEnvironment.js.flow +7 -7
  173. package/multi-actor-environment/ActorUtils.js.flow +1 -1
  174. package/multi-actor-environment/MultiActorEnvironment.js.flow +12 -8
  175. package/multi-actor-environment/MultiActorEnvironmentTypes.js.flow +3 -3
  176. package/mutations/RelayDeclarativeMutationConfig.js.flow +9 -9
  177. package/mutations/RelayRecordProxy.js.flow +8 -11
  178. package/mutations/RelayRecordSourceMutator.js.flow +4 -4
  179. package/mutations/RelayRecordSourceProxy.js.flow +4 -4
  180. package/mutations/RelayRecordSourceSelectorProxy.js.flow +6 -6
  181. package/mutations/applyOptimisticMutation.js.flow +2 -2
  182. package/mutations/commitMutation.js.flow +20 -16
  183. package/mutations/createUpdatableProxy.js.flow +19 -19
  184. package/mutations/readUpdatableFragment.js.flow +3 -3
  185. package/mutations/readUpdatableQuery.js.flow +3 -3
  186. package/mutations/validateMutation.js.flow +7 -7
  187. package/network/RelayNetworkTypes.js.flow +4 -4
  188. package/network/RelayObservable.js.flow +16 -14
  189. package/network/RelayQueryResponseCache.js.flow +3 -3
  190. package/network/wrapNetworkWithLogObserver.js.flow +1 -1
  191. package/package.json +2 -1
  192. package/query/GraphQLTag.js.flow +22 -10
  193. package/query/fetchQuery.js.flow +23 -10
  194. package/query/fetchQuery_DEPRECATED.js.flow +1 -1
  195. package/store/DataChecker.js.flow +43 -9
  196. package/store/NormalizationEngine.js.flow +779 -0
  197. package/store/OperationExecutor.js.flow +173 -70
  198. package/store/RelayConcreteVariables.js.flow +5 -5
  199. package/store/RelayErrorTrie.js.flow +12 -12
  200. package/store/RelayExperimentalGraphResponseHandler.js.flow +3 -3
  201. package/store/RelayExperimentalGraphResponseTransform.js.flow +10 -10
  202. package/store/RelayModernEnvironment.js.flow +41 -26
  203. package/store/RelayModernFragmentSpecResolver.js.flow +1 -1
  204. package/store/RelayModernOperationDescriptor.js.flow +1 -1
  205. package/store/RelayModernRecord.js.flow +46 -22
  206. package/store/RelayModernSelector.js.flow +21 -21
  207. package/store/RelayModernStore.js.flow +219 -58
  208. package/store/RelayOperationTracker.js.flow +2 -2
  209. package/store/RelayOptimisticRecordSource.js.flow +2 -2
  210. package/store/RelayPublishQueue.js.flow +21 -12
  211. package/store/RelayReader.js.flow +130 -58
  212. package/store/RelayRecordSource.js.flow +10 -0
  213. package/store/RelayRecordState.js.flow +1 -1
  214. package/store/RelayReferenceMarker.js.flow +5 -4
  215. package/store/RelayResponseNormalizer.js.flow +130 -54
  216. package/store/RelayStoreSubscriptions.js.flow +52 -8
  217. package/store/RelayStoreTypes.js.flow +153 -64
  218. package/store/RelayStoreUtils.js.flow +15 -7
  219. package/store/ResolverCache.js.flow +2 -2
  220. package/store/ResolverFragments.js.flow +12 -12
  221. package/store/StoreInspector.js.flow +6 -7
  222. package/store/cloneRelayHandleSourceField.js.flow +1 -1
  223. package/store/cloneRelayScalarHandleSourceField.js.flow +1 -1
  224. package/store/createRelayContext.js.flow +1 -1
  225. package/store/createRelayLoggingContext.js.flow +4 -4
  226. package/store/defaultGetDataID.js.flow +2 -2
  227. package/store/isRelayModernEnvironment.js.flow +4 -2
  228. package/store/live-resolvers/LiveResolverCache.js.flow +55 -20
  229. package/store/live-resolvers/LiveResolverSuspenseSentinel.js.flow +3 -3
  230. package/store/live-resolvers/getOutputTypeRecordIDs.js.flow +1 -1
  231. package/store/live-resolvers/isLiveStateValue.js.flow +2 -2
  232. package/store/live-resolvers/resolverDataInjector.js.flow +8 -5
  233. package/store/observeFragmentExperimental.js.flow +49 -20
  234. package/store/observeQueryExperimental.js.flow +5 -5
  235. package/store/readInlineData.js.flow +4 -4
  236. package/store/waitForFragmentExperimental.js.flow +3 -3
  237. package/subscription/requestSubscription.js.flow +7 -7
  238. package/util/NormalizationNode.js.flow +34 -32
  239. package/util/ReaderNode.js.flow +32 -30
  240. package/util/RelayConcreteNode.js.flow +5 -5
  241. package/util/RelayError.js.flow +4 -1
  242. package/util/RelayFeatureFlags.js.flow +21 -1
  243. package/util/RelayProfiler.js.flow +1 -1
  244. package/util/RelayReplaySubject.js.flow +3 -3
  245. package/util/RelayRuntimeTypes.js.flow +11 -11
  246. package/util/createPayloadFor3DField.js.flow +9 -5
  247. package/util/deepFreeze.js.flow +2 -2
  248. package/util/getFragmentIdentifier.js.flow +1 -1
  249. package/util/getPaginationMetadata.js.flow +1 -1
  250. package/util/getPaginationVariables.js.flow +1 -1
  251. package/util/getPendingOperationsForFragment.js.flow +2 -2
  252. package/util/getRefetchMetadata.js.flow +6 -5
  253. package/util/getValueAtPath.js.flow +3 -3
  254. package/util/handlePotentialSnapshotErrors.js.flow +5 -5
  255. package/util/isEmptyObject.js.flow +1 -1
  256. package/util/isPromise.js.flow +2 -2
  257. package/util/isScalarAndEqual.js.flow +1 -1
  258. package/util/recycleNodesInto.js.flow +2 -2
  259. package/util/registerEnvironmentWithDevTools.js.flow +1 -1
  260. package/util/shallowFreeze.js.flow +1 -1
  261. package/util/stableCopy.js.flow +5 -5
  262. package/util/withProvidedVariables.js.flow +14 -10
@@ -0,0 +1,1040 @@
1
+ ---
2
+ id: glossary
3
+ title: Glossary
4
+ slug: /glossary/
5
+ description: Relay terms glossary
6
+ keywords:
7
+ - glossary
8
+ ---
9
+
10
+ import DocsRating from '@site/src/core/DocsRating';
11
+ import {FbInternalOnly, OssOnly} from 'docusaurus-plugin-internaldocs-fb/internal';
12
+
13
+ ## 3D
14
+
15
+ Data-Driven Dependencies. Facebook's way of including the code to render a particular component if and only if it will actually be rendered. Canonical use cases are
16
+
17
+ * **Fields that are typically null**, and which are only rendered when not null.
18
+ * **Unions**. For example, the core news feed item has many different variants, each of which is a separate React component. Which one we render depends on the data (i.e. is "data-driven"). On a given feed, it is likely that most variants will not be rendered, and need not be downloaded.
19
+ * **Component can have different rendering strategies, depending on the data.**
20
+
21
+ <FbInternalOnly>
22
+
23
+ See the [@match](#match) directive, [@module](#module) directive and [the 3D guide](../guides/data-driven-dependencies/server-3d).
24
+
25
+ </FbInternalOnly>
26
+
27
+ <OssOnly>
28
+
29
+ See the [@match](#match) directive and the [@module](#module) directive.
30
+
31
+ </OssOnly>
32
+
33
+ ## Abstract Type
34
+
35
+ GraphQL unions and interfaces are abstract types. See [interface](#interface-graphql).
36
+
37
+ ## Abstract Type Refinement
38
+
39
+ See [type refinement](#type-refinement). If type refinement is a way of conditionally including fields if a type implements a particular concrete type (such as `... on User { name }`), abstract type refinement refers to conditionally including fields if a type implements a particular abstract type (i.e. interface). So, `... on Actor { field }`.
40
+
41
+ ## @arguments
42
+
43
+ A [directive](#directive) that modifies a [fragment spread](#fragment-spread) and is used to pass arguments (defined with [`@argumentDefinitions`](#argumentdefinitions)) to that fragment.
44
+
45
+ ```graphql
46
+ ...Story_story @arguments(storyId: "1234")
47
+ ```
48
+
49
+ ## @argumentDefinitions
50
+
51
+ A directive that modifies a fragment definition and defines the names of the local arguments that the fragment can take, as well as their type.
52
+
53
+ ```graphql
54
+ fragment Store_story on Story
55
+ @argumentDefinitions(storyId: {type: "ID!"}) {
56
+ # etc
57
+ }
58
+ ```
59
+
60
+ If a variable is used in a fragment but not included in an `@argumentDefinitions` directive, Relay will require that the fragment is only spread in queries which declare these variables, or in fragments which ultimately are spread in such a query.
61
+
62
+ Compare with [variables](#variables) and see the [relevant section](../guided-tour/rendering/variables) in the guided tour.
63
+
64
+ ## Artifact
65
+
66
+ Files that are generated by the [Relay compiler](../getting-started/compiler.mdx), typically ending in `.graphql.js`.
67
+
68
+ <FbInternalOnly>
69
+
70
+ See [a guide to Relay artifacts](https://www.internalfb.com/intern/wiki/Relay-team/generated-artifacts/).
71
+
72
+ </FbInternalOnly>
73
+
74
+ ## AST
75
+
76
+ Abstract Syntax Tree. In Relay, there are two types of ASTs, [normalization](#normalization-ast) and [reader](#reader-ast) ASTs.
77
+
78
+ The default export of a `.graphql.js` file is an AST.
79
+
80
+ The Relay compiler parses and transforms GraphQL literals, and generates Relay ASTs (see [artifact](#artifact)). Doing this work at compile time allows the Relay runtime to be faster.
81
+
82
+ ## Availability
83
+
84
+ The concept of availability refers to whether there is enough non-stale, non-invalidated data in the store to fulfill a particular request immediately, or whether a request to server needs to be made in order to fulfill that request.
85
+
86
+ ## Babel Transform
87
+
88
+ A build-time transformation of the Javascript codebase, which turns calls to
89
+
90
+ ```javascript
91
+ graphql`...`
92
+ ```
93
+
94
+ into `require(NAME_OF_GENERATED_ARTIFACT)` calls. See [Babel Plugin](../getting-started/babel-plugin.mdx).
95
+
96
+ ## Client Schema Extension
97
+
98
+ [The GraphQL spec](https://spec.graphql.org/June2018/#sec-Schema-Extension) allows you to define new types, new fields on types, new directives, etc. locally.
99
+
100
+ Relay supports adding types and fields in client schema extension files. Developers use this feature to add fields that contain purely local state that is associated with items on the graph. For example, an `is_selected` field on a `User`.
101
+
102
+ ## CacheConfig
103
+
104
+ A value used to control how a query's response may be cached. Ultimately passed to `environment.execute`.
105
+
106
+ ## Check
107
+
108
+ One of the core functions of the store. Given an operation, determines whether the store has all of the data necessary to render that operation. Calls `DataChecker.check`, which synchronously starts with the root node associated with the operation and walks the data in the store.
109
+
110
+ In practice, exposed as a method on `environment`.
111
+
112
+ In conjunction with the fetch policy, used by `loadQuery` (and other methods) to determine whether it is necessary to make a network request call to fulfill a query.
113
+
114
+ ## Commit
115
+
116
+ After receiving a network response, the payload is committed, or written to the store.
117
+
118
+ Commit is also the verb used to describe initiating a mutation and writing its data to the store.
119
+
120
+ ## Compiler
121
+
122
+ The piece of code which scans your Javascript files for `graphql` tagged nodes and generates the appropriate files (`.graphql.js` files, `$Parameters.js` files, etc.)
123
+
124
+ The generated output from the compiler is committed and checked into the repository.
125
+
126
+ ## Concrete Request
127
+
128
+ An Abstract Syntax Tree representing a query, subscription or mutation.
129
+
130
+ The default export of a `.graphql.js` file corresponding to a query, subscription or mutation.
131
+
132
+ In addition, calls to `graphql`...`` are turned into concrete requests at build time via the Relay Babel transform.
133
+
134
+ **See the important safety notes at Preloadable Concrete Request.**
135
+
136
+ ## Config
137
+
138
+ A [file or javascript object](../getting-started/compiler-config.mdx) which controls, among other things, which files are scanned by the Relay [compiler](#compiler) for your project.
139
+
140
+ ## @connection
141
+
142
+ A directive which declares that a field implements the [connection](#connection) spec.
143
+
144
+ ## Connection
145
+
146
+ <FbInternalOnly>
147
+
148
+ A field implementing the [connection spec](https://relay.dev/graphql/connections.htm). See <a href="https://www.internalfb.com/intern/wiki/Graphql-connections-for-hack-developers/Connection-spec/">here</a> for more details on the spec, and the section of the guided tour on <a href="../guided-tour/list-data/pagination/">rendering list data and pagination</a>.
149
+
150
+ </FbInternalOnly>
151
+
152
+ <OssOnly>
153
+
154
+ A field implementing the [connection spec](https://relay.dev/graphql/connections.htm). See the section of the guided tour on <a href="../guided-tour/list-data/pagination/">rendering list data and pagination</a>.
155
+
156
+ </OssOnly>
157
+
158
+ See also [`usePaginationFragment`](../api-reference/use-pagination-fragment).
159
+
160
+ ## Container
161
+
162
+ A term for a higher order component that provided a child component with the data from queries and fragments. Associated with Relay Modern.
163
+
164
+ You should use the Relay hooks API when possible.
165
+
166
+ ## Data Checker
167
+
168
+ A class exposing a single method, `check`, which synchronously starts with the root node associated with the operation and walks the data in the store. It determines whether the data in the store suffices to fulfill a given operation.
169
+
170
+ Called by `store.check`.
171
+
172
+ ## DataID
173
+
174
+ The globally-unique identifier of a record. Can be generated on the client with [missing field handlers](#missing-field-handler). Usually corresponds to an Ent's ID (if available), but guaranteed to equal the value of the `__id` field.
175
+
176
+ [`updater`](#updater) and [`optimisticUpdater`](#optimisticupdater) functions are passed instances of [`RelaySourceSelectorProxy`](#recordproxy). Calling `.get(id)` with the DataID on a `RelaySourceSelectorProxy` will look up that item in the store, and return a proxy of it.
177
+
178
+ ## Data Masking
179
+
180
+ Refers to the idea that a component should not be able to access any data it does declare in its fragment or query, even inadvertently. This prevents accidental coupling of data between components, and means that every component can be refactored in isolation. It negates the risk that removing a field in a child component will accidentally break a different component, allowing components to *move fast, with stable infrastructure*.
181
+
182
+ Also refers to the practice of hiding the data of child components from their parents, in keeping with the idea.
183
+
184
+ In Relay, a query declared like `query FooQuery { viewer { ...subcomponent_``viewer_name } }` will not be able to access the data declared by `subcomponent_viewer_name` without access to the `ReaderFragment` representing the `subcomponent_viewer_name` fragment.
185
+
186
+ See the [Thinking in Relay guide](../principles-and-architecture/thinking-in-relay#data-masking).
187
+
188
+ ## @defer
189
+
190
+ A directive which can be added to a fragment spread or inline fragment to avoid blocking on that fragment's data. For more detail refer to GraphQL's [documentation on the @defer directive](https://github.com/graphql/graphql-wg/blob/main/rfcs/DeferStream.mdx#defer).
191
+
192
+ <FbInternalOnly>
193
+
194
+ See [Incremental Data Delivery](https://www.internalfb.com/intern/staticdocs/relay/docs/guides/incremental-data-delivery/).
195
+
196
+ </FbInternalOnly>
197
+
198
+ ## Definition
199
+
200
+ In the compiler, a definition refers to the text within a GraphQL literal where an operation or fragment was defined.
201
+
202
+ ## Descriptor
203
+
204
+ Can refer to an `OperationDescriptor` or `RequestDescriptor`. Descriptors are types used internally to the Relay codebase, and generally, refer to an object containing the minimum amount of information needed to uniquely identify an operation or request, such as (for a `RequestIdentifier`), a node, identifier and variables.
205
+
206
+ ## DevTools
207
+
208
+ An awesome Chrome extension for debugging Relay network requests, the Relay store and Relay events. Helpful for answering questions like "Why am I not seeing the data I expect to see?" "Why did this component suspend?" etc.
209
+
210
+ See the [documentation](https://relay.dev/docs/debugging/relay-devtools/).
211
+
212
+ ## Document
213
+
214
+ In the compiler, a Document refers to a GraphQL literal that contains one or more operation or fragment [definitions](#definition). Relay requires that GraphQL literals in JavaScript files contain a single definition.
215
+
216
+ ## Directive
217
+
218
+ A special instruction, starting with `@` and contained in a `graphql` literal or graphql file, which provides special instructions to the Relay compiler or to the server. Examples include `@defer`, `@stream` and `@match`.
219
+
220
+ ## Disposable
221
+
222
+ Any object which contains a `.dispose` method which takes no parameters and provides no return value. Many objects in Relay (such query references and entrypoint references) and the return value of many methods (such as calls to `.subscribe` or `.retain`) are disposables.
223
+
224
+ ## Entrypoint
225
+
226
+ A lightweight object containing information on the components which need to be loaded (as in the form of calls to `JSResource`) and which queries need to be loaded (in the form of preloadable concrete requests) before a particular route, popover or other piece of conditionally loaded UI can be rendered.
227
+
228
+ All queries which are required for the initial rendering of a piece of UI should be included in that UI's entrypoint.
229
+
230
+ Entrypoints can contain queries and other entrypoints.
231
+
232
+ See also [preloadable concrete request](#preloadable-concrete-request) and [JSResource](#jsresource).
233
+
234
+ ## Environment
235
+
236
+ An object bringing together many other Relay objects, most importantly a store and a network. Also, includes a publish queue, operation loader, scheduler and [missing fields handlers](#missing-field-handler).
237
+
238
+ Set using a `RelayEnvironmentProvider` and passed down through React context.
239
+
240
+ All non-internal Relay hooks require being called within a Relay environment context.
241
+
242
+ ## Execute
243
+
244
+ Executing a query, mutation or subscription (collectively, an operation) roughly means "create a lazy observable that, when subscribed to, will make a network request fulfilling the operation and write the returned data to the store."
245
+
246
+ A variety of `execute` methods are exposed on the Relay environment.
247
+
248
+ ## Fetch Policy
249
+
250
+ A string that determines in what circumstances to make a network request in which circumstances to fulfill the query using data in the store, if available. Either `network-only`, `store-and-network`, `store-or-network` or `store-only`. (Some methods do not accept all fetch policies.)
251
+
252
+ ## Field
253
+
254
+ Basically, anything you can select using a query, mutation, subscription or fragment. For example, `viewer`, `comment_create(input: $CommentCreateData)` and `name` are all fields.
255
+
256
+ The GraphQL schema comprises many fields.
257
+
258
+ ## Fragment
259
+
260
+ Fragment is an overloaded term, and has at least two distinct meanings in Relay.
261
+
262
+ ### Fragments as a GraphQL concept
263
+
264
+ The fundamental reusable unit of GraphQL. Unlike queries, subscriptions and mutations, fragments cannot be queried on their own and must be embedded within a request.
265
+
266
+ Fragments can be spread into queries, mutations, subscriptions and other fragments.
267
+
268
+ Fragments can be standalone (as in `fragment Component_user on User { name }`) or inline, as in the `... on User { name }` in `query MyQuery { node(id: $id) { ... on User { name } } }`.
269
+
270
+ Fragments are always defined on a particular type (`User` in the example), which defines what fields can be selected within it.
271
+
272
+ ### Fragments within Relay
273
+
274
+ Within Relay, a fragment refers to the fields that are read out for a given fragment/operation. The term is also used colloquially to refer to reader ASTs. So, e.g. the following query and fragment might have identical reader ASTs:
275
+
276
+ ```graphql
277
+ query Foo {
278
+ actor { name }
279
+ }
280
+ ```
281
+
282
+ ```
283
+ fragment Bar on Query {
284
+ actor { name }
285
+ }
286
+ ```
287
+
288
+ ## Fragment Identifier
289
+
290
+ A string, providing enough information to provide the data for a particular fragment. For example:
291
+
292
+ `1234{"scale":2}/Story_story/{"scale":2}/"4567"`
293
+
294
+ This identifies by its persist ID (`1234`), followed by the variables it accepts, followed by the `Story_story` fragment (which does not have a persist id) and the variables it uses, followed by the Data ID (likely, the `id` field) of whatever Story happened to be referenced.
295
+
296
+ ## Fragment Reference
297
+
298
+ A parameter passed to `useFragment`. Obtained by accessing the value onto which a fragment was spread in another [query](#query), fragment, subscription or mutation. For example,
299
+
300
+ ```javascript
301
+ const queryData = usePreloadedQuery(
302
+ graphql`query ComponentQuery { viewer { account_user { ...Component_name } } }`,
303
+ {},
304
+ );
305
+
306
+ // queryData.viewer is the FragmentReference
307
+ // Though this would usually happen in another file, you can
308
+ // extract the value of Component_name as follows:
309
+ const fragmentData = useFragment(
310
+ graphql`fragment Component_name on User { name }`,
311
+ queryData?.viewer?.account_user,
312
+ );
313
+ ```
314
+
315
+ Just like a query reference and a graphql tagged literal describing a query (i.e. a concrete request) can be used to access the data from a query, a fragment reference and a graphql tagged literal describing a fragment (i.e. a reader fragment) can be used to access the data referenced from a fragment.
316
+
317
+ ## Fragment Resource
318
+
319
+ An internal class supporting lazily loaded queries. Exposes two important methods:
320
+
321
+ * `read`, which is meant to be called during a component's render phase. It will attempt to fulfill a query from the store (by calling `environment.lookup`) and suspend if the data is not available. It furthermore writes the results from the attempted read (whether a promise, error or result) to an internal cache, and updates that cached value when the promise resolves or rejects.
322
+ * `subscribe`, which is called during the commit phase, and establishes subscriptions to the Relay store.
323
+
324
+ If the component which calls `.read` successfully loads a query, but suspends on a subsequent hook before committing, the data from that query can be garbage collected before the component ultimately renders. Thus, components which rely on `FragmentResource` are at risk of rendering null data.
325
+
326
+ Compare to [query resource](#query-resource).
327
+
328
+ ## Fragment Spread
329
+
330
+ A fragment spread is how one fragment is contained in a query, subscription, mutation or other fragment. In the following example, `...Component_name` is a fragment spread:
331
+
332
+ ```graphql
333
+ query ComponentQuery {
334
+ viewer {
335
+ account_user {
336
+ ...Component_name
337
+ }
338
+ }
339
+ }
340
+ ```
341
+
342
+ In order for a fragment to be spread in a particular location, the types must match. For example, if `Component_name` was defined as follows: `fragment Component_name on User { name }`, this spread would be valid, as `viewer.account_user` has type `User`.
343
+
344
+ ## Garbage Collection
345
+
346
+ Relay can periodically garbage collect data from queries which are no longer being retained.
347
+
348
+ See more information in the [guided tour](https://relay.dev/docs/guided-tour/reusing-cached-data/presence-of-data/#garbage-collection-in-relay).
349
+
350
+ ## GraphQLTaggedNode
351
+
352
+ This is the type of the call to
353
+
354
+ ```js
355
+ graphql`...`
356
+ ```
357
+
358
+ It is the union of ReaderFragment, ReaderInlineDataFragment, ConcreteRequest, and ConcreteUpdatableQuery.
359
+
360
+ <OssOnly>
361
+
362
+ Note that Flow can be configured to understand that the type of a GraphQL literal is the type of the default export of the generated `.graphql.js` file.
363
+
364
+ </OssOnly>
365
+
366
+ <FbInternalOnly>
367
+
368
+ Note that Flow is configured to understand that the type of a GraphQL literal is the type of the default export of the generated `.graphql.js` file.
369
+
370
+ </FbInternalOnly>
371
+
372
+ ## ID
373
+
374
+ Relay treats ids specially. In particular, it does the following two things:
375
+
376
+ * The compiler automatically adds a selection of the `id` field on every type where the `id` field has type `ID` or `ID!`.
377
+ * When [normalizing](#normalization) data, if an object has an `id` property, that field is used as its ID in the store.
378
+
379
+ There are types in the schema where the `id` field does not have type `ID` or `ID!` (e.g. has the type `string` or `number`). If a user selects this field themselves, this field is used as an id. This is unexpected and incorrect behavior.
380
+
381
+ ## @include
382
+
383
+ A directive that is added to fields, inline fragments and fragment spreads, and allows for conditional inclusion. It is the opposite of the [`@skip`](#skip) directive.
384
+
385
+ In the compiler, the `@include`/`@skip` directives are treated specially, and produce `Condition` nodes.
386
+
387
+ ## @inline
388
+
389
+ A directive that applies to fragments which enables developers to pass masked data to functions that are executed outside of the React render phase.
390
+
391
+ Normally, data is read out using `useFragment`. However, this function can only be called during the render phase. If store data is needed outside of the render phase, a developer has several options:
392
+
393
+ * read that data during the render phase, and pass it to the function/have the function close over that data. (See also [#relay])
394
+ * pass a reference to an `@inline` fragment, which can then be accessed (outside of the render phase) using the `readInlineData` function.
395
+
396
+ This directive causes them to be read out when the parent fragment is read out, and unmasked by the call to `readInlineData`.
397
+
398
+ ## Interface (GraphQL)
399
+
400
+ An *Interface* is an abstract type that includes a certain set of fields that a type must include to implement the interface.
401
+
402
+ You can spread a fragment on an interface onto a concrete type (for example `query MyQuery { viewer { account_user { ...on Actor { can_viewer_message } } }`) or a fragment on a concrete type onto an interface (for example `query MyQuery { node(id: 4) { ... on User { name } } }`). You are no longer allowed to spread a fragment on an interface onto an interface.
403
+
404
+ See also abstract type refinement.
405
+
406
+ ## Invalidation
407
+
408
+ In certain cases, it is easy to determine the outcome of a mutation. For example, if you "like" a Feedback, the like count will increment and `viewer_did_like` will be set to true. However, in other cases, such as when you are blocking another user, the full impact on the data in your store is hard to determine.
409
+
410
+ For situations like these, Relay allows you to invalidate a record (or the whole store), which will cause the data to be re-fetched the next time it is rendered.
411
+
412
+ See the [section in the guide](https://relay.dev/docs/guided-tour/reusing-cached-data/staleness-of-data/).
413
+
414
+ ## JSResource
415
+
416
+ A lightweight API for specifying that a React component should be loaded on demand, instead of being bundled with the first require (as would be the case if you imported or required it directly.)
417
+
418
+ This API is safe to use in entrypoint files.
419
+
420
+ <OssOnly>
421
+
422
+ See [the npm module](https://www.npmjs.com/package/jsresource).
423
+
424
+ </OssOnly>
425
+
426
+ ## Lazy Loading
427
+
428
+ A query or entry point is lazy loaded if the request for the data occurs at render time.
429
+
430
+ Lazy loaded queries and entry points have performance downsides, are vulnerable to being over- and under-fetched, and can result in components being rendered with null data. They should be avoided.
431
+
432
+ ## Linked Record
433
+
434
+ A linked record is a record that is directly accessible from another record. For example, in the query `query MyQuery { viewer { account_user { active_instant_game { id } } } }`, `active_instant_game` (which has the type `Application` is a linked record of `account_user`.
435
+
436
+ A linked record cannot be queried by itself, but must be queried by selecting subfields on it.
437
+
438
+ Compare to [value](#value).
439
+
440
+ ## Literal
441
+
442
+ A GraphQL literal is a call to
443
+
444
+ ```javascript
445
+ graphql`...`
446
+ ```
447
+
448
+ in your code. These are pre-processed, and replaced at build time with a [GraphQLTaggedNode](#graphqltaggednode) containing an [AST](#ast) representation of the contents of the literal.
449
+
450
+ ## @live
451
+
452
+ A docblock tag that can be added to mark a Relay resolver as live. To learn more, refer to the [live fields section](https://relay.dev/docs/guides/relay-resolvers/live-fields/) of the Relay resolver documentation.
453
+
454
+ <FbInternalOnly>
455
+
456
+ ## @live_query
457
+ A directive used on GraphQL queries that enables data updates to be delivered over time without any custom server-side code. This directive provides a more efficient and maintainable alternative to polling (running the same query over and over again).
458
+
459
+ Live queries are a feature of GraphQL within Meta and supported by the [Real-Time GraphQL team](https://www.internalfb.com/omh/view/real_time_graphql/oncall_profile). To learn more about GraphQL live queries, refer to the [GraphQL Live Queries wiki](https://www.internalfb.com/intern/wiki/GraphQL_Live_Queries/Overview/).
460
+
461
+ You can learn more about how to use @live_query with Relay on Web with server-polling [here](https://www.internalfb.com/intern/wiki/GraphQL_Live_Queries/Live_Queries_for_Relay/) and client-polling [here](https://www.internalfb.com/intern/wiki/GraphQL_Live_Queries/Live_Queries_for_Relay_(Client_Polling)/).
462
+ </FbInternalOnly>
463
+
464
+ ## Lookup
465
+
466
+ One of the main methods exposed by the Relay store. Using a [reader selector](#reader-selector), traverses the data in the store and returns a [snapshot](#snapshot), which contains the data being read, as well as information about whether data is missing and other pieces of information. Also exposed via the Relay environment.
467
+
468
+ Calls [`Reader.read`](#reader).
469
+
470
+ ## @match
471
+
472
+ A directive that, when used in combination with [@module](#module), allows users to download specific JS components alongside the rest of the GraphQL payload if the field decorated with @match has a certain type. See [3D](#3d).
473
+
474
+ ## MatchContainer
475
+
476
+ A component that renders the component returned in conjunction with a field decorated with the [@match](#match) directive. See [3D](#3d).
477
+
478
+ ## Missing Field Handler
479
+
480
+ A function that provides a [DataID](#dataid) for a field (for singular and plural linked fields) and default values (for scalar fields).
481
+
482
+ For example, you may have already fetched an item with id: 4, and are executing a query which selects `node(id: 4)`. Without a missing field handler, Relay would not know that the item with id: 4 will be returned by `node(id: 4)`, and would thus attempt to fetch this data over the network. Providing a missing field handler can inform Relay that the results of this selection are present at id: 4, thus allowing Relay to avoid a network request.
483
+
484
+ `getRelayFBMissingFieldHandlers.js` provides this and other missing field handlers.
485
+
486
+ ## @module
487
+
488
+ A directive that, when used in combination with [@match](#match), allows users to specify which JS components to download if the field decorated with @match has a certain type. See [3D](#3d).
489
+
490
+ ## Module
491
+
492
+ A ["Module"](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules) refers to a React component or a piece of JavaScript code.
493
+
494
+ In the context of Relay, modules can by dynamically loaded with the @module directive. This directive allows developers to specify which JavaScript components should be downloaded (from a CDN for example) based on the type of a field decorated with the @match directive. This approach is part of Relay's [data-driven dependencies](#3d) strategy, where components are only loaded if they are actually needed for rendering.
495
+
496
+ ## Mutation
497
+
498
+ A mutation is a combination of two things: a mutation on the backend, followed by query against updated data.
499
+
500
+ <FbInternalOnly>
501
+
502
+ See the [guide on mutations](../guided-tour/updating-data/graphql-mutations), and [this article](https://www.internalfb.com/intern/wiki/Graphql-for-hack-developers/mutation-root-fields/) on defining mutations in your hack code.
503
+
504
+ </FbInternalOnly>
505
+
506
+ <OssOnly>
507
+
508
+ See the [guide on mutations](../guided-tour/updating-data/graphql-mutations).
509
+
510
+ </OssOnly>
511
+
512
+ ## Mutation Root Query
513
+
514
+ The root object of a mutation query. In an `updater` or `optimisticUpdater`, calling `store.getRootField('field_name')` will return the object from the mutation root query named `field_name`.
515
+
516
+ The fields exposed on this object are **not** the same as those available for queries, and differ across mutations.
517
+
518
+ ## Network
519
+
520
+ Relay environments contain a `network` object, which exposes a single `execute` function. All network requests initiated by Relay will go through this piece of code.
521
+
522
+ This provides a convenient place to handle cross-cutting concerns, like authentication and authorization.
523
+
524
+ ## Node
525
+
526
+ A Node is an object that implements the Node interface in GraphQL, which requires an `id` field of type `ID`. This is part of the [Global Object Identification specification](https://relay.dev/graphql/objectidentification.htm) that provides a standardized way to fetch and identify objects in a GraphQL schema.
527
+
528
+ In Relay, the Node interface is fundamental to how data normalization and caching work. When Relay encounters an object with an `id` field, it uses that ID as the key for storing the object in its normalized cache. This enables efficient data deduplication, updates, and garbage collection.
529
+
530
+ Nodes can be refetched using the `node` field on the Query root type by passing their global ID: `query { node(id: "abc123") { ... } }`. This allows Relay to fetch data for any object implementing the Node interface without needing to know the specific field path to that object.
531
+
532
+ ## Normalization
533
+
534
+ Normalization is the process of turning nested data (such as the server response) and turning it into flat data (which is how Relay stores it in the store.)
535
+
536
+ See the [response normalizer](#response-normalizer).
537
+
538
+ ## Normalization AST
539
+
540
+ An [AST](#ast) that is associated with an [operation](#operation) that (in combination with [variables](#variables)) can be used to:
541
+ * write a network payload to the store,
542
+ * write an optimistic response to the store,
543
+ * determine whether a query can be fulfilled from data in the store, and
544
+ * determine which records in the store are reachable (used in [garbage collection](#garbage-collection)).
545
+
546
+ Unlike the [reader AST](#reader-ast), the normalization AST includes information on the contents of nested fragments.
547
+
548
+ The generated artifact associated with an operation (e.g. `FooQuery.graphql.js`) contains both a normalization AST and a reader AST.
549
+
550
+ ## Normalization Selector
551
+
552
+ A selector defines the starting point for a traversal into the graph for the purposes of targeting a subgraph, combining a GraphQL fragment, variables, and the Data ID for the root object from which traversal should progress.
553
+
554
+ ## Notify
555
+
556
+ A method exposed by the store which will notify each [subscriber](#subscribe) whose data has been modified. Causes components which are rendering data that has been modified to re-render with new data.
557
+
558
+ ## Observable
559
+
560
+ The fundamental abstraction in Relay for representing data that may currently be present, but may also only be available in the future.
561
+
562
+ Observables differ from promises in that if the data in an observable has already been loaded, you can access it synchronously as follows:
563
+
564
+ ```javascript
565
+ const completedObservable = Observable.from("Relay is awesome!");
566
+ let valueFromObservable;
567
+ observable.subscribe({
568
+ next: (value) => {
569
+ valueFromObservable = value;
570
+ /* this will execute in the same tick */
571
+ },
572
+ });
573
+ console.log(valueFromObservable); // logs out "Relay is awesome!"
574
+ ```
575
+
576
+ This is advantageous, as it allows Relay hooks to not suspend if data is already present in the store.
577
+
578
+ In Relay, observables are a partial implementation of [RxJS Observables](https://rxjs-dev.firebaseapp.com/guide/observable).
579
+
580
+ ## Operation
581
+
582
+ In [GraphQL](https://spec.graphql.org/June2018/#sec-Language.Operations), a query, subscription or mutation.
583
+
584
+ In Relay, every operation also has an associated [fragment](#fragments-within-relay). So, an accurate mental model is that operations are fragments whose [type condition](#type-condition) is that they are on [Query/Mutation/Subscription](#root-type) and for which Relay knows how to make a network request.
585
+
586
+ ## Operation Descriptor
587
+
588
+ Colloquially, an operation descriptor is an operation and variables.
589
+
590
+ The operation descriptor flowtype contains the three pieces of information that Relay needs to work with the data: [a reader selector](#reader-selector), a [normalization selector](#normalization-selector) and a [request descriptor](#request-descriptor).
591
+
592
+ The variables are filtered to exclude unneeded variables and are populated to include default values for missing variables, thus ensuring that requests that differ in irrelevant ways are cached using the same request ID.
593
+
594
+ ## Operation Mock Resolver
595
+
596
+ A function taking an operation descriptor and returning a network response or error, used when testing.
597
+
598
+ ## Operation Tracker
599
+
600
+ The Relay Operation Tracker is a component within the Relay runtime that manages and tracks the lifecycle of [operations](#operation) (queries, subscriptions, and mutations), in the Relay store. It maintains mappings between operations and affected data owners, manages promises for asynchronous updates, and resolves dependencies by notifying subscribers when data changes, ensuring components render with the latest data. For more implementation details of the Operation Tracker, see the [OSS code here](https://github.com/facebook/relay/blob/main/packages/relay-runtime/store/RelayOperationTracker.js).
601
+
602
+ ## Optimistic Update
603
+
604
+ An Optimistic Update in Relay is a technique used to immediately reflect the expected outcome of a mutation in the UI before the server response is received.
605
+
606
+ This approach enhances user experience by providing instant feedback for actions, such as liking a post, without waiting for the server to confirm the change.
607
+
608
+ Optimistic updates assume the mutation will succeed and temporarily update the store with the anticipated result. If the mutation fails, the optimistic update is rolled back to maintain data consistency. This is typically achieved by providing an optimisticResponse in the mutation configuration, which specifies the expected changes to the data.
609
+
610
+ See the [documentation on optimistic updates](../guided-tour/updating-data/graphql-mutations/#optimistic-updates) for examples of how to use this feature.
611
+
612
+ ## Optimistic Updater
613
+
614
+ An Optimistic Updater in Relay is a function that allows developers to imperatively modify the store's data in anticipation of a mutation's success.
615
+
616
+ Unlike [optimistic responses](../guided-tour/updating-data/graphql-mutations/#optimistic-response), which are declarative, optimistic updaters provide more control and flexibility, enabling updates to data not directly selected in the mutation or complex changes that cannot be handled by declarative mutation directives.
617
+
618
+ Optimistic updaters are executed when a mutation is triggered and are rolled back if the mutation fails. They are particularly useful for scenarios where multiple optimistic responses affect the same store value, and fine grained control is needed by the developer to ensure that the store remains consistent.
619
+
620
+ See the documentation on [optimistic updaters](../guided-tour/updating-data/graphql-mutations/#optimistic-updaters) for examples of how to use them.
621
+
622
+ ## Pagination
623
+
624
+ Querying a list of data (a [connection](#connection)) in parts is known as pagination.
625
+
626
+ See the [graphql docs](https://graphql.org/learn/pagination/) and our [guided tour](../guided-tour/list-data/pagination).
627
+
628
+ ## Payload
629
+
630
+ The value returned from the GraphQL server as part of the response to a request.
631
+
632
+ ## Plural Field
633
+
634
+ A field for which the value is an array of [values](#value) or [records](#record).
635
+
636
+ ## @preloadable
637
+
638
+ A directive that modifies queries and which causes Relay to generate `$Parameters.js` files and preloadable concrete requests. Required if the query is going to be used as part of an entry point.
639
+
640
+ ## Preloadable Concrete Request
641
+
642
+ A small, lightweight object that provides enough information to initiate the query and fetch the full query AST (the `ConcreteRequest`.) This object will only be generated if the query is annotated with `@preloadable`, and is the default export of `$parameters.js` files. It is only generated for queries which are annotated with `@preloadable`.
643
+
644
+ Unlike concrete requests (the default export of `.graphql.js` files), preloadable concrete requests are extremely light weight.
645
+
646
+ Note that entrypoints accept either preloadable concrete requests or concrete requests in the `.queries[queryName].parameters` position. However, ***because a concrete request is not a lightweight object, you should only include preloadable concrete requests here.***
647
+
648
+ Note also that preloadable queries have `id` fields, whereas other queries do not.
649
+
650
+ ## Preloadable Query Registry
651
+
652
+ A central registry which will execute callbacks when a particular Query AST (concrete request) is loaded.
653
+
654
+ Required because of current limitations on dynamically loading components in React Native.
655
+
656
+ ## Project
657
+
658
+ For Relay to process a file with a GraphQL literal, it must be included in a project. A project specifies the folders to which it applies and the schema against which to evaluate GraphQL literals, and includes other information needed by the Relay compiler.
659
+
660
+ <FbInternalOnly>
661
+
662
+ Projects are defined in a single [config](#config) file, found [here](https://www.internalfb.com/intern/diffusion/WWW/browse/master/scripts/relay/compiler-rs/config.www.json) and [here](https://www.internalfb.com/intern/diffusion/FBS/browse/master/xplat/relay/compiler-rs/config.xplat.json).
663
+
664
+ </FbInternalOnly>
665
+
666
+ ## Publish
667
+
668
+ One of the main methods exposed by the `store`. Accepts a [record source](#record-source), from which the records in the store are updated. Also updates the mapping of which records in the store have been updated as a result of publishing.
669
+
670
+ One or more calls to `publish` should be followed by a call to [`notify`](#notify).
671
+
672
+ ## Publish Queue
673
+
674
+ A class used internally by the environment to keep track of, apply and revert pending (optimistic) updates; commit client updates; and commit server responses.
675
+
676
+ Exposes mutator methods like `commitUpdate` that only add or remove updates from the queue, as well as a `run` method that actually performs these updates and calls `store.publish` and `store.notify`.
677
+
678
+ ## Query
679
+
680
+ A [GraphQL query](https://graphql.org/learn/queries/) is a request that can be sent to a GraphQL server in combination with a set of [variables](../guided-tour/rendering/variables), in order to fetch some data. It consists of a [selection](#selection) of fields, and potentially includes other [fragments](#fragment).
681
+
682
+ ## Query Executor
683
+
684
+ A class that normalizes and publishes optimistic responses and network responses from a network observable to the store.
685
+
686
+ After each response is published to the store, `store.notify` is called, updating all components that need to re-render.
687
+
688
+ Used by `environment` in methods such as `execute`, `executeWithSource` and `executeMutation`, among others.
689
+
690
+ ## Query Reference
691
+
692
+ A Query Reference is an opaque token that represents a query that we have started fetching, but may not have been returned by the network yet. It's returned by functions like `loadQuery` and serves as an identifier for which query we want to render.
693
+
694
+ Query references are intentionally opaque to the user - they don't expose the query's internal state or data directly. Instead, they are passed to `usePreloadedQuery` to access the data from a preloaded query.
695
+
696
+ The query reference pattern enables efficient data loading by allowing queries to be initiated early (such as in response to user interactions like hovering or route changes) and then consumed later when the component actually renders.
697
+
698
+ Query references are disposable objects - they should be disposed of when no longer needed to prevent memory leaks and allow proper cleanup of network requests and subscriptions.
699
+
700
+ ## Query Resource
701
+
702
+ A class for helping with lazily loaded queries and exposing two important methods: `prepare` and `retain`.
703
+
704
+ * `prepare` is called during a component's render method, and will either read an existing cached value for the query, or fetch the query and suspend. It also stores the results of the attempted read (whether the data, a promise for the data or an error) in a local cache.
705
+ * `retain` is called after the component has successfully rendered.
706
+
707
+ If the component which calls `.prepare` successfully loads a query, but suspends on a subsequent hook before committing, the data from that query can be garbage collected before the component ultimately renders. Thus, components which rely on `QueryResource` are at risk of rendering null data.
708
+
709
+ Compare to [fragment resource](#fragment-resource).
710
+
711
+ ## `@raw_response_type`
712
+
713
+ A directive added to queries which tells Relay to generate types that cover the `optimisticResponse` parameter to `commitMutation`.
714
+
715
+ See the [guided tour on updating data](../guided-tour/updating-data/graphql-mutations/#optimistic-response) for more.
716
+
717
+ ## Reader
718
+
719
+ A core component of the Relay runtime responsible for reading data from the store. The Reader traverses the normalized data in the store using a [reader AST](#reader-ast) and constructs the denormalized data structure that matches the shape expected by components.
720
+
721
+ The Reader is called by the store's [lookup](#lookup) method and is fundamental to how Relay provides data to React components. It handles data masking by only exposing the fields that were explicitly selected in fragments and queries, ensuring components can only access the data they declared dependencies for.
722
+
723
+ The Reader also manages missing data detection, determining when insufficient data is available in the store to fulfill a request, which helps Relay decide when network requests are necessary.
724
+
725
+ ## Reader AST
726
+
727
+ An [AST](#AST) that is used to read the data selected in a given fragment.
728
+
729
+ Both [operations](#operation) and [fragments](#fragment) have reader ASTs.
730
+
731
+ A reader AST contains information about which fragments are spread at a given location, but unlike a [normalization AST](#normalization-ast), does not include information about the fields selected within these fragments.
732
+
733
+ ## Reader Fragment
734
+
735
+ TODO
736
+
737
+ See [GraphQLTaggedNode](#graphqltaggednode).
738
+
739
+ ## Reader Selector
740
+
741
+ An object containing enough information for the store to traverse its data and construct an object represented by a query or fragment. Intuitively, this "selects" a portion of the object graph.
742
+
743
+ See also [lookup](#lookup).
744
+
745
+ ## Record
746
+
747
+ A record refers to any item in the Relay [store](#store) that is stored by [ID](#id). [Values](#value) are not records; most everything else is.
748
+
749
+ ## Record Source
750
+
751
+ An abstract interface for storing [records](#record), keyed by [DataID](#dataid), used both for representing the store's cache for updates to it.
752
+
753
+ ## Record Source Selector Proxy
754
+
755
+ See [record proxy](#record-proxy).
756
+
757
+ ## Record Proxy
758
+
759
+ See the [store documentation](../api-reference/store).
760
+
761
+ ## Ref Counting
762
+
763
+ The pattern of keeping track of how many other objects can access a particular object, and cleaning it up or disposing of it when that number reaches zero. This pattern is implemented throughout the Relay codebase.
764
+
765
+ ## Reference Marker
766
+
767
+ The Relay Reference Marker is a component within the Relay runtime responsible for traversing the data graph and marking references to data that should be retained in the Relay store. It ensures data consistency by preventing premature garbage collection of data required for operations or fragments. The marker handles various data selections, manages variables, and interacts with the operation loader to process module imports, ensuring that all necessary data dependencies are retained.
768
+ See the [OSS code](https://github.com/facebook/relay/blob/main/packages/relay-runtime/store/RelayReferenceMarker.js) for implementation details.
769
+
770
+ ## @refetchable
771
+
772
+ A directive that modifies a fragment, and causes Relay to generate a query for that fragment.
773
+
774
+ This yields efficiency gains. The fragment can be loaded as part of a single, larger query initially (thus requiring only a single request to fetch all of the data), and yet refetched independently.
775
+
776
+ ## @relay
777
+
778
+ A directive that allows you to turn off data masking and is used on plural types.
779
+
780
+ See [the documentation](../api-reference/graphql-and-directives/#relaymask-boolean).
781
+
782
+ ## Relay Classic
783
+
784
+ An even older version of Relay.
785
+
786
+ ## Relay Hooks
787
+
788
+ The easiest-to-use, safest Relay API. It relies on suspense, and is safe to use in React concurrent mode.
789
+
790
+ You should not write new code using Relay Classic or Relay Modern.
791
+
792
+ ## Relay Modern
793
+
794
+ An older version of Relay. This version of Relay had an API that was heavily focused on Containers.
795
+
796
+ ## Relay Resolvers
797
+
798
+ Relay Resolvers is an experimental Relay feature which enables modeling derived state as client-only fields in Relay’s GraphQL graph.
799
+
800
+ See also [the Relay Resolvers Introduction](../guides/relay-resolvers/introduction.mdx).
801
+
802
+ ## Release Buffer
803
+
804
+ As queries are released (no longer [retained](#retain)), their root nodes are stored in a release buffer of fixed size, and only evicted by newly released queries when there isn't enough space in the release buffer. When Relay runs garbage collection, queries that are present in the release buffer and not disposed.
805
+
806
+ The size of the release buffer is configured with the `gcReleaseBufferSize` parameter.
807
+
808
+ ## `@required`
809
+
810
+ A Relay directive that makes handling potentially `null` values more ergonomic.
811
+
812
+ See also [the `@required` guide](../guides/required-directive/).
813
+
814
+ ## Request
815
+
816
+ A request refers to an API call made over the network to access or mutate some data, or both.
817
+
818
+ A query, when initiated, may or may not involve making a request, depending on whether the query can be fulfilled from the store or not.
819
+
820
+ ## Request Descriptor
821
+
822
+ An object associating a [concrete request](#concrete-request) and [variables](#variables), as well as a pre-computed request ID. The variables should be filtered to exclude unneeded variables and are populated to include default values for missing variables, thus ensuring that requests that differ in irrelevant ways are cached using the same request ID.
823
+
824
+ ## Resolver
825
+
826
+ An overloaded term, mostly referring to virtual fields, but also occasionally referring to other things.
827
+
828
+ ### When describing a field
829
+
830
+ A resolver field is a "virtual" field that is backed by a function from a fragment reference on the same type to some arbitrary value.
831
+
832
+ A live resolver is a "virtual" field that is backed by an external data source. e.g. one might use an external resolver to expose some state that is stored in local storage, or in an external Flux store.
833
+
834
+ ### Other meanings
835
+
836
+ It can also be a [fragment spec resolver](#fragment-spec-resolver) or a [operation mock resolver](#operation-mock-resolver).
837
+
838
+ ## Response
839
+
840
+ The data returned by a GraphQL server in response to a query, mutation, or subscription. A GraphQL response typically contains a `data` field with the requested information, and may also include an `errors` field if any errors occurred during execution.
841
+
842
+ In Relay, responses are processed by the [Response Normalizer](#response-normalizer), which transforms the nested response data into a flat, normalized format suitable for storage in the Relay store. This normalization process enables efficient data deduplication, caching, and updates.
843
+
844
+ Responses can also include extensions and other metadata depending on the GraphQL server implementation. Relay handles both successful responses and error responses, providing appropriate error handling and data consistency guarantees.
845
+
846
+ ## Response Normalizer
847
+
848
+ A class, exposing a single method `normalize`. This will traverse the denormalized response from the API request, normalize it and write the normalized results into a given `MutableRecordSource`. It is called from the query executor.
849
+
850
+ ## Restore
851
+
852
+ TODO
853
+
854
+ ## Retain
855
+
856
+ TODO
857
+
858
+ ## Render Policy
859
+
860
+ The "Render Policy" in Relay determines how data is rendered in components, specifically whether to use "full" or "partial" rendering. This policy integrates with React's Suspense to manage when components should suspend based on data availability.
861
+ * Full Rendering: This approach waits until all required data is available before rendering a component. It ensures that components do not render with incomplete data, which can prevent flickering or unexpected UI changes.
862
+ * Partial Rendering: This approach allows components to render with the data that is currently available, even if some data is missing. It can improve perceived performance by displaying parts of the UI sooner, but may lead to components rendering with null or incomplete data.
863
+
864
+ The choice between full and partial rendering can be configured per environment or query, allowing developers to optimize for specific use cases.
865
+ <FbInternalOnly>
866
+ For example, Comet defaults to partial rendering to accommodate certain product behaviors, while other environments may use full rendering to ensure data consistency.
867
+ </FbInternalOnly>
868
+
869
+ ## Revert
870
+
871
+ TODO
872
+
873
+ ## Root Field
874
+
875
+ A root field is a top-level field on a GraphQL root type — Query, Mutation, or Subscription. These fields serve as entry points for GraphQL operations, allowing clients to fetch, modify, or subscribe to data.
876
+
877
+
878
+ ## Root Type
879
+
880
+ The [GraphQL spec](https://spec.graphql.org/June2018/#sec-Root-Operation-Types) defines three special root types: Query, Mutation and Subscription. Queries must select fields off of the Query root type, etc.
881
+
882
+ ## Root
883
+
884
+ Outermost React Component for a given page or screen. Can be associated with an entrypoint.
885
+
886
+ Roots for entrypoints are referred to by the [`JSResource`](#JSResource) to the root React component module.
887
+
888
+ ## Scalar
889
+
890
+ A scalar in GraphQL is a primitive, indivisible leaf value that cannot have subfields. Scalars represent basic data types, such as numbers, strings, booleans, and identifiers, which are returned directly to the client without further selection or nesting.
891
+
892
+ GraphQL defines several built-in scalar types:
893
+ * Int: A signed 32‐bit integer
894
+ * Float: A signed double-precision floating-point value
895
+ * String: A UTF‐8 character sequence
896
+ * Boolean: true or false
897
+ * ID: A unique identifier, often serialized as a string
898
+
899
+ In addition to these built-in types, GraphQL servers may define custom scalars for values like dates, times, or other domain-specific primitive types.
900
+
901
+ Relay represents GraphQL scalars as corresponding primitive JavaScript values (such as numbers, booleans, and strings). For custom scalars, Relay treats them as opaque values, providing support for their representation and use, but does not interpret their content.
902
+
903
+ For more details, see:
904
+ * [The GraphQL Specification on Scalars](https://spec.graphql.org/October2021/#sec-Scalars)
905
+ * [Relay Return Types Guide](../guides/relay-resolvers/return-types/#scalar-types)
906
+
907
+
908
+ ## Scheduler
909
+
910
+ TODO
911
+
912
+ ## Schema
913
+
914
+ A collection of all of the GraphQL types that are known to Relay, for a given [project](#project).
915
+
916
+ <FbInternalOnly>
917
+
918
+ ## Schema Sync
919
+
920
+ The GraphQL [schema](#schema) is derived from annotations on Hack classes in the www repository.
921
+
922
+ Periodically, those changes are synced to fbsource in a schema sync diff. If the updated schema would break Relay on fbsource, these schema sync diffs will not land.
923
+
924
+ If a field is removed from www, but is only used in fbsource, the application developer may not notice that the field cannot be removed. This is a common source of schema breakages.
925
+
926
+ For more info, look [here](https://www.internalfb.com/intern/wiki/GraphQL/Build_Infra/Schema_Sync/) and [here](https://www.internalfb.com/intern/wiki/Relay-team/GraphQL_Schema_Sync/).
927
+ </FbInternalOnly>
928
+
929
+ ## Selection
930
+
931
+ A "selection of fields" refers to the fields you are requesting on an object that you are accessing, as part of a query, mutation, subscription or fragment.
932
+
933
+ ## Selector
934
+
935
+ See [normalization selector](#normalization-selector).
936
+
937
+ ## @skip
938
+
939
+ A directive that is added to fields, inline fragments and fragment spreads, and allows for conditional inclusion. It is the opposite of the [`@include`](#include) directive.
940
+
941
+ ## Snapshot
942
+
943
+ The results of running a reader selector against the data currently in the store. See [lookup](#lookup).
944
+
945
+ ## Stale
946
+
947
+ In Relay, "stale" describes cached data in the client store that is no longer considered fresh or up-to-date. By default, Relay treats cached data as valid indefinitely unless it is explicitly marked as stale through invalidation APIs (`invalidateRecord`, `invalidateStore`) or if it exceeds the configured query cache expiration time. When data is stale, Relay triggers a network refetch on the next query evaluation to ensure the UI reflects the most current information. Components can also subscribe to invalidation events to respond immediately when data becomes stale (`useSubscribeToInvalidationState` hook). This mechanism helps maintain data consistency and timely updates after changes such as mutations.
948
+
949
+ For more details, see the [Relay Staleness of Data documentation](../guided-tour/reusing-cached-data/staleness-of-data.mdx).
950
+
951
+ ## Store
952
+
953
+ The Relay Store is a local cache in the Relay runtime that manages the lifecycle of records fetched from a GraphQL server, as well as client-side data. It normalizes and de-dupes data, supports subscriptions and [optimistic updates](#optimistic-update), and handles garbage collection and data retention to ensure efficient data access and consistency.
954
+
955
+ In addition to server-fetched data, the Relay Store can manage client-side data, including data from resolvers and local state. Client-side resolvers compute derived data based on existing records, allowing components to access both server and client data seamlessly. The store also supports the integration of local state by adding client-specific fields to the GraphQL schema, enabling developers to query and manage local state using Relay.
956
+
957
+ ## @stream
958
+
959
+ A directive which can be added to a field of `List` type that enables the individual items in the list to be delivered incrementally. The client can render the initial
960
+ set of items while waiting for the server to deliver the rest of the items. For more detail refer to GraphQL's [documentation on the @stream directive](https://github.com/graphql/graphql-wg/blob/main/rfcs/DeferStream.mdx#stream).
961
+
962
+ ## @stream_connection
963
+
964
+ A directive that is like the @connection directive for pagination, except modified to enable items in the pagination queue to be delivered incrementally. It has the additional parameter `initial_count` to specify how many items to deliver in the initial payload. To learn more about how to use this directive refer to the [Streaming Pagination page](https://relay.dev/docs/guided-tour/list-data/streaming-pagination/).
965
+
966
+ ## Subscribe
967
+
968
+ A method exposed by the Relay store. Accepts a callback and a snapshot (see [lookup](#lookup)). The Relay store will call this callback when [`notify`](#notify) is called, if the data referenced by that snapshot has been updated or invalidated.
969
+
970
+ ## Subscription
971
+
972
+ [GraphQL Subscriptions](../guided-tour/updating-data/graphql-subscriptions) are a mechanism which allow clients to subscribe to changes in a piece of data from the server, and get notified whenever that data changes.
973
+
974
+ A GraphQL Subscription looks very similar to a query, with the exception that it uses the subscription keyword:
975
+
976
+ ```graphql
977
+ subscription FeedbackLikeSubscription($input: FeedbackLikeSubscribeData!) {
978
+ feedback_like_subscribe(data: $input) {
979
+ feedback {
980
+ id
981
+ like_count
982
+ }
983
+ }
984
+ }
985
+ ```
986
+
987
+ <FbInternalOnly>
988
+
989
+ See also [the guide](../guides/writing-subscriptions).
990
+
991
+ </FbInternalOnly>
992
+
993
+ ## Transaction ID
994
+
995
+ A unique id for a given instance of a call to `network.execute`. This ID will be consistent for the entire duration of a network request. It can be consumed by custom log functions passed to `RelayModernEnvironment`.
996
+
997
+ ## Traversal
998
+
999
+ There are four tree traversals that are core to understanding the internal behavior of Relay.
1000
+
1001
+ * Using the normalization AST:
1002
+ * When Relay normalizes the payload it receives from the GraphQL server in the Response Normalizer;
1003
+ * When Relay determines whether there is enough data for to fulfill an operation, in the Data Checker; and
1004
+ * When Relay determines what data is no longer accessible during garbage collection, in the [Reference Marker](#reference-marker).
1005
+ * Using the reader AST:
1006
+ * When Relay reads data for rendering, in the Reader.
1007
+
1008
+ ## Type
1009
+
1010
+ The GraphQL type of a field is a description of a field on a schema, in terms of what subfields it has, or what its representation is (String, number, etc.).
1011
+
1012
+ See also [interface](#interface-graphql), [abstract type](#abstract-type) and [the GraphQL docs](https://graphql.org/learn/schema/#type-language) for more info.
1013
+
1014
+ ## Type Refinement
1015
+
1016
+ The inclusion of a fragment of particular type in a location only known to potentially implement that type. This allows us to select fields if and only if they are defined on that particular object, and return null otherwise.
1017
+
1018
+ For example, `node(id: 4) { ... on User { name } }`. In this case, we do not know ahead of time whether `node(id: 4)` is a User. If it is, this fragment will include the user name.
1019
+
1020
+ See also [abstract type refinement](#abstract-type-refinement).
1021
+
1022
+ ## Updater
1023
+
1024
+ A callback passed to `commitMutation`, which provides the application developer with imperative control over the data in the store.
1025
+
1026
+ See [the documentation](../guided-tour/updating-data/introduction.mdx) and also [optimistic updater](#optimistic-updater).
1027
+
1028
+ ## Value
1029
+
1030
+ A single value on a record, such as `has_viewer_liked`, or `name`.
1031
+
1032
+ Compare with [linked record](#linked-record).
1033
+
1034
+ ## Variables
1035
+
1036
+ GraphQL variables are a construct that allows referencing dynamic values inside a GraphQL query. They must be provided when the query is initiated, and can be used throughout nested fragments.
1037
+
1038
+ See the [variables section of the guided tour](../guided-tour/rendering/variables) and compare with [@argumentDefinitions](#argumentdefinitions).
1039
+
1040
+ <DocsRating />