@@ -18,9 +18,9 @@ A GraphQL service generates a response from a request via execution.
18
18
- {extensions} (optional): A map reserved for implementation-specific additional
19
19
information.
20
20
21
- Given this information, the result of {Request (schema, document, operationName ,
22
- variableValues, initialValue)} produces the response, to be formatted according
23
- to the Response section below.
21
+ Given this information, the result of {ExecuteRequest (schema, document,
22
+ operationName, variableValues, initialValue)} produces the response, to be
23
+ formatted according to the Response section below.
24
24
25
25
Implementations should not add additional properties to a _ request_ , which may
26
26
conflict with future editions of the GraphQL specification. Instead,
@@ -39,19 +39,19 @@ and have no effect on the observable execution, validation, or response of a
39
39
GraphQL document. Descriptions and comments on executable documents MAY be used
40
40
for non-observable purposes, such as logging and other developer tools.
41
41
42
- ## Processing Requests
42
+ ## Executing Requests
43
43
44
44
<a name =" #sec-Executing-Requests " >
45
45
<!-- Legacy link, this section was previously titled "Executing Requests" -->
46
46
</a >
47
47
48
- To process a request, the executor must have a parsed {Document} and a selected
48
+ To execute a request, the executor must have a parsed {Document} and a selected
49
49
operation name to run if the document defines multiple operations, otherwise the
50
50
document is expected to only contain a single operation. The result of the
51
- request is determined by the result of performing this operation according to
52
- the "Performing Operations” section below.
51
+ request is determined by the result of executing this operation according to the
52
+ "Executing Operations” section below.
53
53
54
- The {Request ()} algorithm contains the preamble for _ execution_ , handling
54
+ The {ExecuteRequest ()} algorithm contains the preamble for _ execution_ , handling
55
55
concerns such as determining the operation and coercing the inputs, before
56
56
passing the request on to the relevant algorithm for the operation's type which
57
57
then performs any other necessary preliminary steps (for example establishing
@@ -65,18 +65,19 @@ error_, and once _execution_ begins will typically be an _execution error_.
65
65
selection set_ through {ExecuteRootSelectionSet()}, and hence _ execution_ begins
66
66
when {ExecuteRootSelectionSet()} is called for the first time in a request.
67
67
68
- Request (schema, document, operationName, variableValues, initialValue):
68
+ ExecuteRequest (schema, document, operationName, variableValues, initialValue):
69
69
70
70
- Let {operation} be the result of {GetOperation(document, operationName)}.
71
71
- Let {coercedVariableValues} be the result of {CoerceVariableValues(schema,
72
72
operation, variableValues)}.
73
73
- If {operation} is a query operation:
74
- - Return {Query(operation, schema, coercedVariableValues, initialValue)}.
74
+ - Return {ExecuteQuery(operation, schema, coercedVariableValues,
75
+ initialValue)}.
75
76
- Otherwise if {operation} is a mutation operation:
76
- - Return {Mutation(operation, schema, coercedVariableValues, initialValue)}.
77
- - Otherwise if {operation} is a subscription operation:
78
- - Return {Subscription(operation, schema, coercedVariableValues,
77
+ - Return {ExecuteMutation(operation, schema, coercedVariableValues,
79
78
initialValue)}.
79
+ - Otherwise if {operation} is a subscription operation:
80
+ - Return {Subscribe(operation, schema, coercedVariableValues, initialValue)}.
80
81
81
82
GetOperation(document, operationName):
82
83
@@ -97,11 +98,11 @@ they should be reported in the list of "errors" in the response and the request
97
98
must fail without execution.
98
99
99
100
Typically validation is performed in the context of a request immediately before
100
- calling {Request ()}, however a GraphQL service may process a request without
101
- immediately validating the document if that exact same document is known to have
102
- been validated before. A GraphQL service should only execute operations which
103
- _ at some point_ were known to be free of any validation errors, and have since
104
- not changed.
101
+ calling {ExecuteRequest ()}, however a GraphQL service may execute a request
102
+ without immediately validating the document if that exact same document is known
103
+ to have been validated before. A GraphQL service should only execute operations
104
+ which _ at some point_ were known to be free of any validation errors, and have
105
+ since not changed.
105
106
106
107
For example: the document may be validated during development, provided it does
107
108
not later change, or a service may validate a document once and memoize the
@@ -149,7 +150,7 @@ CoerceVariableValues(schema, operation, variableValues):
149
150
150
151
Note: This algorithm is very similar to {CoerceArgumentValues()}.
151
152
152
- ## Performing Operations
153
+ ## Executing Operations
153
154
154
155
<a name =" #sec-Executing-Operations " >
155
156
<!-- Legacy link, this section was previously titled "Executing Operations" -->
@@ -166,9 +167,9 @@ If the operation is a query, the result of the operation is the result of
166
167
executing the operation’s _ root selection set_ with the query root operation
167
168
type.
168
169
169
- An initial value may be provided when performing a query operation.
170
+ An initial value may be provided when executing a query operation.
170
171
171
- Query (query, schema, variableValues, initialValue):
172
+ ExecuteQuery (query, schema, variableValues, initialValue):
172
173
173
174
- Let {queryType} be the root Query type in {schema}.
174
175
- Assert: {queryType} is an Object type.
@@ -186,7 +187,7 @@ It is expected that the top level fields in a mutation operation perform
186
187
side-effects on the underlying data system. Serial execution of the provided
187
188
mutations ensures against race conditions during these side-effects.
188
189
189
- Mutation (mutation, schema, variableValues, initialValue):
190
+ ExecuteMutation (mutation, schema, variableValues, initialValue):
190
191
191
192
- Let {mutationType} be the root Mutation type in {schema}.
192
193
- Assert: {mutationType} is an Object type.
@@ -201,10 +202,10 @@ _response stream_ where each event in the event stream is the result of
201
202
executing the operation’s _ root selection set_ for each new event on an
202
203
underlying _ source stream_ .
203
204
204
- Performing a subscription operation creates a persistent function on the service
205
+ Executing a subscription operation creates a persistent function on the service
205
206
that maps an underlying _ source stream_ to a returned _ response stream_ .
206
207
207
- Subscription (subscription, schema, variableValues, initialValue):
208
+ Subscribe (subscription, schema, variableValues, initialValue):
208
209
209
210
- Let {sourceStream} be the result of running
210
211
{CreateSourceEventStream(subscription, schema, variableValues, initialValue)}.
@@ -213,9 +214,9 @@ Subscription(subscription, schema, variableValues, initialValue):
213
214
variableValues)}.
214
215
- Return {responseStream}.
215
216
216
- Note: In a large-scale subscription system, the {Subscription ()} and
217
- {SubscriptionEvent ()} algorithms may be run on separate services to maintain
218
- predictable scaling properties. See the section below on Supporting
217
+ Note: In a large-scale subscription system, the {Subscribe ()} and
218
+ {ExecuteSubscriptionEvent ()} algorithms may be run on separate services to
219
+ maintain predictable scaling properties. See the section below on Supporting
219
220
Subscriptions at Scale.
220
221
221
222
As an example, consider a chat application. To subscribe to new messages posted
@@ -336,7 +337,8 @@ MapSourceToResponseEvent(sourceStream, subscription, schema, variableValues):
336
337
- Let {responseStream} be a new _ event stream_ .
337
338
- When {sourceStream} emits {sourceValue}:
338
339
- Let {executionResult} be the result of running
339
- {SubscriptionEvent(subscription, schema, variableValues, sourceValue)}.
340
+ {ExecuteSubscriptionEvent(subscription, schema, variableValues,
341
+ sourceValue)}.
340
342
- If internal {error} was raised:
341
343
- Cancel {sourceStream}.
342
344
- Complete {responseStream} with {error}.
@@ -350,21 +352,21 @@ MapSourceToResponseEvent(sourceStream, subscription, schema, variableValues):
350
352
- Complete {responseStream} normally.
351
353
- Return {responseStream}.
352
354
353
- Note: Since {SubscriptionEvent ()} handles all _ execution error_ , and _ request
354
- error_ only occur during {CreateSourceEventStream()}, the only remaining error
355
- condition handled from {SubscriptionEvent ()} are internal exceptional errors not
356
- described by this specification.
355
+ Note: Since {ExecuteSubscriptionEvent ()} handles all _ execution error_ , and
356
+ _ request error_ only occur during {CreateSourceEventStream()}, the only
357
+ remaining error condition handled from {ExecuteSubscriptionEvent ()} are internal
358
+ exceptional errors not described by this specification.
357
359
358
- SubscriptionEvent (subscription, schema, variableValues, initialValue):
360
+ ExecuteSubscriptionEvent (subscription, schema, variableValues, initialValue):
359
361
360
362
- Let {subscriptionType} be the root Subscription type in {schema}.
361
363
- Assert: {subscriptionType} is an Object type.
362
364
- Let {rootSelectionSet} be the _ root selection set_ in {subscription}.
363
365
- Return {ExecuteRootSelectionSet(variableValues, initialValue,
364
366
subscriptionType, rootSelectionSet, "normal")}.
365
367
366
- Note: The {SubscriptionEvent ()} algorithm is intentionally similar to {Query()}
367
- since this is how each event result is produced.
368
+ Note: The {ExecuteSubscriptionEvent ()} algorithm is intentionally similar to
369
+ {ExecuteQuery()} since this is how each event result is produced.
368
370
369
371
#### Unsubscribe
370
372
@@ -660,7 +662,7 @@ A valid GraphQL executor can resolve the four fields in whatever order it chose
660
662
(however of course ` birthday ` must be resolved before ` month ` , and ` address `
661
663
before ` street ` ).
662
664
663
- When performing a mutation, the selections in the top most selection set will be
665
+ When executing a mutation, the selections in the top most selection set will be
664
666
executed in serial order, starting with the first appearing field textually.
665
667
666
668
When executing a collected fields map serially, the executor must consider each
0 commit comments