-
Notifications
You must be signed in to change notification settings - Fork 15
/
relay-extensions.graphql
286 lines (213 loc) · 8.29 KB
/
relay-extensions.graphql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
# If you're looking for an up to date version of this file
# Look here:https://github.com/facebook/relay/blob/main/compiler/crates/relay-schema/src/relay-extensions.graphql
# BUT WAIT: Do not forget to remove the `__clientField` directive from the file
# The GraphQL LSP will error out because `__*` is reserved for introspection queries.
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
directive @relay_test_operation on QUERY | MUTATION | SUBSCRIPTION
"""
(Relay only)
The hooks APIs that Relay exposes allow you to read data from the store only
during the render phase. In order to read data from outside of the render
phase (or from outside of React), Relay exposes the `@inline` directive. The
data from a fragment annotated with `@inline` can be read using `readInlineData`.
[Read More](https://relay.dev/docs/api-reference/graphql-and-directives/#inline)
"""
directive @inline on FRAGMENT_DEFINITION
directive @no_inline(raw_response_type: Boolean) on FRAGMENT_DEFINITION
"""
(Relay only)
A directive added to queries which tells Relay to generate types that cover
the `optimisticResponse` parameter to `commitMutation`.
[Read More](https://relay.dev/docs/glossary/#raw_response_type)
"""
directive @raw_response_type on QUERY | MUTATION | SUBSCRIPTION
directive @DEPRECATED__relay_ignore_unused_variables_error on QUERY | MUTATION | SUBSCRIPTION
"""
(Relay Only)
For use with [`useRefetchableFragment`](https://relay.dev/docs/api-reference/use-refetchable-fragment/).
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).
[Read More](https://relay.dev/docs/api-reference/use-refetchable-fragment/#arguments)
"""
directive @refetchable(
queryName: String!
directives: [String!]
) on FRAGMENT_DEFINITION
"""
(Relay Only)
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.
The `hackPreloader` argument is FB only and generates a Hack preloader file.
[Read More](https://relay.dev/docs/glossary/#preloadable)
"""
directive @preloadable(hackPreloader: Boolean = false @static) on QUERY
"""
(Relay Only)
A directive that allows you to turn off Relay's data masking.
Read more
[here](https://relay.dev/docs/api-reference/graphql-and-directives/#relayplural-boolean)
and
[here](https://relay.dev/docs/api-reference/graphql-and-directives/#relaymask-boolean).
"""
directive @relay(
mask: Boolean
plural: Boolean
) on FRAGMENT_DEFINITION | FRAGMENT_SPREAD
# MatchTransform
"""
(Relay Only)
A directive that, when used in combination with `@module`, allows users to
download specific JS components alongside the rest of the GraphQL payload if
the field decorated with [`@match`](https://relay.dev/docs/glossary/#match)
has a certain type. See [3D](https://relay.dev/docs/glossary/#3d).
[Read More](https://relay.dev/docs/glossary/#match)
"""
directive @match(key: String @static) on FIELD
"""
(Relay Only)
A directive that, when used in combination with
[`@match`](https://relay.dev/docs/glossary/#match), allows users to specify
which JS components to download if the field decorated with @match has a
certain type. See [3D](https://relay.dev/docs/glossary/#3d).
[Read More](https://relay.dev/docs/glossary/#module)
"""
directive @module(name: String!) on FRAGMENT_SPREAD
# ConnectionTransform
"""
(Relay Only)
A directive which declares that a field implements the connection spec.
[Read More](https://relay.dev/docs/guided-tour/list-data/pagination/)
"""
directive @connection(
key: String!
filters: [String]
handler: String
dynamicKey_UNSTABLE: String
) on FIELD
directive @stream_connection(
key: String!
filters: [String]
handler: String
label: String
initial_count: Int!
if: Boolean = true
use_customized_batch: Boolean = false
dynamicKey_UNSTABLE: String
) on FIELD
# RequiredTransform
enum RequiredFieldAction {
NONE
LOG
THROW
}
"""
(Relay Only)
`@required` is a directive you can add to fields in your Relay queries to
declare how null values should be handled at runtime. You can think of it as
saying "if this field is ever null, its parent field is invalid and should be
null".
[Read More](https://www.internalfb.com/intern/staticdocs/relay/docs/guides/required-directive/) (FB only)
"""
directive @required(action: RequiredFieldAction! @static) on FIELD
# DeclarativeConnection
"""
(Relay Only)
For use within mutations. After the mutation request is complete, this field
will be removed from the store.
[Read More](https://relay.dev/docs/guided-tour/updating-data/graphql-mutations/#updating-data-once-a-request-is-complete)
"""
directive @deleteRecord on FIELD
"""
(Relay Only)
For use within mutations. After the mutation request is complete, this edge
will be removed from its parent connection.
[Read More](https://relay.dev/docs/guided-tour/updating-data/graphql-mutations/#updating-data-once-a-request-is-complete)
"""
directive @deleteEdge(connections: [ID!]!) on FIELD
"""
(Relay Only)
For use within mutations. After the mutation request is complete, this edge
will be appended to its parent connection.
[Read More](https://relay.dev/docs/guided-tour/updating-data/graphql-mutations/#updating-data-once-a-request-is-complete)
"""
directive @appendEdge(connections: [ID!]!) on FIELD
"""
(Relay Only)
For use within mutations. After the mutation request is complete, this edge
will be prepended to its parent connection.
[Read More](https://relay.dev/docs/guided-tour/updating-data/graphql-mutations/#updating-data-once-a-request-is-complete)
"""
directive @prependEdge(connections: [ID!]!) on FIELD
"""
(Relay Only)
For use within mutations. After the mutation request is complete, this node
will be appended to its parent connection.
[Read More](https://relay.dev/docs/guided-tour/updating-data/graphql-mutations/#updating-data-once-a-request-is-complete)
"""
directive @appendNode(connections: [ID!]!, edgeTypeName: String!) on FIELD
"""
(Relay Only)
For use within mutations. After the mutation request is complete, this node
will be prepended to its parent connection.
[Read More](https://relay.dev/docs/guided-tour/updating-data/graphql-mutations/#updating-data-once-a-request-is-complete)
"""
directive @prependNode(connections: [ID!]!, edgeTypeName: String!) on FIELD
# RelayResolver
directive @relay_resolver(
fragment_name: String!
import_path: String!
live: Boolean
) on FIELD_DEFINITION
"""
(Relay Only)
Reading this Client Edge field triggers a network roundtrip or "waterfall". The
consuming component will suspend until that request has been fulfilled.
"""
directive @waterfall on FIELD
"""
(Relay Only)
A special scalar type which can be used as the return type of a Relay Resolver.
When used, the resolver field will derive its TypeScript/Flow type from the
return value of the Resolver function.
[Learn More](https://relay.dev/docs/next/guides/relay-resolvers/)
"""
scalar RelayResolverValue
"""
(Relay Only)
Marks a Client Schema Extension type as being an Output Type. This means that if
a Relay Resolver returns an edge to this type, the Resolver will be expected to
return the full object, rather than an ID.
This is intended for use on "weak" objects, which don't have their own strong
identity, but rather are conceptually owned by the parent object.
"""
directive @RelayOutputType on OBJECT
"""
(Relay Only)
Marks a given query or fragment as updatable.
[Read More](https://fb.quip.com/4FZaADvkQPPl)
"""
directive @updatable on QUERY | FRAGMENT_DEFINITION
"""
(Relay Only)
Marks a given fragment as assignable.
[Read More](https://fb.quip.com/4FZaADvkQPPl)
"""
directive @assignable on FRAGMENT_DEFINITION
"""
(Relay Only)
Exposes a fragment's data as a new field which can be null checked to ensure it
matches the parent selection.
"""
directive @alias(as: String) on FRAGMENT_SPREAD | INLINE_FRAGMENT
"""
(Relay Only)
Indicates that a given directive argument is expected to be provided statically.
If a non-static value is provided, it will result in a validation error.
Used for arguments which are expected to be read by the Relay compiler.
"""
directive @static on ARGUMENT_DEFINITION