@@ -18,10 +18,15 @@ A GraphQL service generates a response from a request via execution.
1818- {extensions} (optional): A map reserved for implementation-specific additional
1919 information.
2020
21- Given this information, the result of {ExecuteRequest (schema, document,
21+ Given this information, the result of {ProcessRequest (schema, document,
2222operationName, variableValues, initialValue)} produces the response, to be
2323formatted according to the Response section below.
2424
25+ :: Formally, _ execution_ starts when executing the root selection set in
26+ {ExecuteRootSelectionSet()}. For convenience, this section also contains
27+ preliminary steps required for execution such as coercing variables or getting a
28+ source event stream.
29+
2530Implementations should not add additional properties to a _ request_ , which may
2631conflict with future editions of the GraphQL specification. Instead,
2732{extensions} provides a reserved location for implementation-specific additional
@@ -33,13 +38,13 @@ Note: GraphQL requests do not require any specific serialization format or
3338transport mechanism. Message serialization and transport mechanisms should be
3439chosen by the implementing service.
3540
36- ## Executing Requests
41+ ## Processing Requests
3742
38- To execute a request, the executor must have a parsed {Document} and a selected
43+ To process a request, the executor must have a parsed {Document} and a selected
3944operation name to run if the document defines multiple operations, otherwise the
4045document is expected to only contain a single operation. The result of the
41- request is determined by the result of executing this operation according to the
42- "Executing Operations” section below.
46+ request is determined by the result of processing this operation according to
47+ the "Processing Operations” section below.
4348
4449:: We define _ execution_ as the process of executing the operation's root
4550selection set through {ExecuteSelectionSet()}, thus _ execution_ begins when
@@ -50,19 +55,20 @@ the _execution_ itself.
5055Note: An error raised before _ execution_ begins will typically be a _ request
5156error_ , and once _ execution_ begins will typically be a _ field error_ .
5257
53- ExecuteRequest (schema, document, operationName, variableValues, initialValue):
58+ ProcessRequest (schema, document, operationName, variableValues, initialValue):
5459
5560- Let {operation} be the result of {GetOperation(document, operationName)}.
5661- Let {coercedVariableValues} be the result of {CoerceVariableValues(schema,
5762 operation, variableValues)}.
5863- If {operation} is a query operation:
59- - Return {ExecuteQuery (operation, schema, coercedVariableValues,
64+ - Return {ProcessQuery (operation, schema, coercedVariableValues,
6065 initialValue)}.
6166- Otherwise if {operation} is a mutation operation:
62- - Return {ExecuteMutation (operation, schema, coercedVariableValues,
67+ - Return {ProcessMutation (operation, schema, coercedVariableValues,
6368 initialValue)}.
6469- Otherwise if {operation} is a subscription operation:
65- - Return {Subscribe(operation, schema, coercedVariableValues, initialValue)}.
70+ - Return {ProcessSubscription(operation, schema, coercedVariableValues,
71+ initialValue)}.
6672
6773GetOperation(document, operationName):
6874
@@ -78,14 +84,14 @@ GetOperation(document, operationName):
7884### Validating Requests
7985
8086As explained in the Validation section, only requests which pass all validation
81- rules should be executed . If validation errors are known, they should be
87+ rules should be processed . If validation errors are known, they should be
8288reported in the list of "errors" in the response and the request must fail
83- without _ execution _ .
89+ without processing .
8490
8591Typically validation is performed in the context of a request immediately before
86- _ execution _ , however a GraphQL service may execute a request without immediately
92+ processing , however a GraphQL service may execute a process without immediately
8793validating it if that exact same request is known to have been validated before.
88- A GraphQL service should only execute requests which _ at some point_ were known
94+ A GraphQL service should only process requests which _ at some point_ were known
8995to be free of any validation errors, and have since not changed.
9096
9197For example: the request may be validated during development, provided it does
@@ -132,7 +138,7 @@ CoerceVariableValues(schema, operation, variableValues):
132138
133139Note: This algorithm is very similar to {CoerceArgumentValues()}.
134140
135- ## Executing Operations
141+ ## Processing Operations
136142
137143The type system, as described in the "Type System" section of the spec, must
138144provide a query root operation type. If mutations or subscriptions are
@@ -145,9 +151,9 @@ If the operation is a query, the result of the operation is the result of
145151executing the operation’s _ root selection set_ with the query root operation
146152type.
147153
148- An initial value may be provided when executing a query operation.
154+ An initial value may be provided when processing a query operation.
149155
150- ExecuteQuery (query, schema, variableValues, initialValue):
156+ ProcessQuery (query, schema, variableValues, initialValue):
151157
152158- Let {queryType} be the root Query type in {schema}.
153159- Assert: {queryType} is an Object type.
@@ -165,7 +171,7 @@ It is expected that the top level fields in a mutation operation perform
165171side-effects on the underlying data system. Serial execution of the provided
166172mutations ensures against race conditions during these side-effects.
167173
168- ExecuteMutation (mutation, schema, variableValues, initialValue):
174+ ProcessMutation (mutation, schema, variableValues, initialValue):
169175
170176- Let {mutationType} be the root Mutation type in {schema}.
171177- Assert: {mutationType} is an Object type.
@@ -177,12 +183,13 @@ ExecuteMutation(mutation, schema, variableValues, initialValue):
177183
178184If the operation is a subscription, the result is an _ event stream_ called the
179185_ response stream_ where each event in the event stream is the result of
180- executing the operation for each new event on an underlying _ source stream_ .
186+ executing the operation’s root _ selection set_ for each new event on an
187+ underlying _ source stream_ .
181188
182- Executing a subscription operation creates a persistent function on the service
189+ Processing a subscription operation creates a persistent function on the service
183190that maps an underlying _ source stream_ to a returned _ response stream_ .
184191
185- Subscribe (subscription, schema, variableValues, initialValue):
192+ ProcessSubscription (subscription, schema, variableValues, initialValue):
186193
187194- Let {sourceStream} be the result of running
188195 {CreateSourceEventStream(subscription, schema, variableValues, initialValue)}.
@@ -191,8 +198,8 @@ Subscribe(subscription, schema, variableValues, initialValue):
191198 variableValues)}.
192199- Return {responseStream}.
193200
194- Note: In a large-scale subscription system, the {Subscribe ()} and
195- {ExecuteSubscriptionEvent ()} algorithms may be run on separate services to
201+ Note: In a large-scale subscription system, the {ProcessSubscription ()} and
202+ {ProcessSubscriptionEvent ()} algorithms may be run on separate services to
196203maintain predictable scaling properties. See the section below on Supporting
197204Subscriptions at Scale.
198205
@@ -313,7 +320,7 @@ MapSourceToResponseEvent(sourceStream, subscription, schema, variableValues):
313320- Let {responseStream} be a new _ event stream_ .
314321- When {sourceStream} emits {sourceValue}:
315322 - Let {response} be the result of running
316- {ExecuteSubscriptionEvent (subscription, schema, variableValues,
323+ {ProcessSubscriptionEvent (subscription, schema, variableValues,
317324 sourceValue)}.
318325 - If internal {error} was raised:
319326 - Cancel {sourceStream}.
@@ -328,21 +335,21 @@ MapSourceToResponseEvent(sourceStream, subscription, schema, variableValues):
328335 - Complete {responseStream} normally.
329336- Return {responseStream}.
330337
331- Note: Since {ExecuteSubscriptionEvent ()} handles all _ execution error_ , and
338+ Note: Since {ProcessSubscriptionEvent ()} handles all _ execution error_ , and
332339_ request error_ only occur during {CreateSourceEventStream()}, the only
333- remaining error condition handled from {ExecuteSubscriptionEvent ()} are internal
340+ remaining error condition handled from {ProcessSubscriptionEvent ()} are internal
334341exceptional errors not described by this specification.
335342
336- ExecuteSubscriptionEvent (subscription, schema, variableValues, initialValue):
343+ ProcessSubscriptionEvent (subscription, schema, variableValues, initialValue):
337344
338345- Let {subscriptionType} be the root Subscription type in {schema}.
339346- Assert: {subscriptionType} is an Object type.
340347- Let {rootSelectionSet} be the _ root selection set_ in {subscription}.
341348- Return {ExecuteRootSelectionSet(variableValues, initialValue,
342349 subscriptionType, rootSelectionSet, "normal")}.
343350
344- Note: The {ExecuteSubscriptionEvent ()} algorithm is intentionally similar to
345- {ExecuteQuery ()} since this is how each event result is produced.
351+ Note: The {ProcessSubscriptionEvent ()} algorithm is intentionally similar to
352+ {ProcessQuery ()} since this is how each event result is produced.
346353
347354#### Unsubscribe
348355
@@ -637,7 +644,7 @@ A valid GraphQL executor can resolve the four fields in whatever order it chose
637644(however of course ` birthday ` must be resolved before ` month ` , and ` address `
638645before ` street ` ).
639646
640- When executing a mutation, the selections in the top most selection set will be
647+ When processing a mutation, the selections in the top most selection set will be
641648executed in serial order, starting with the first appearing field textually.
642649
643650When executing a grouped field set serially, the executor must consider each
@@ -785,8 +792,8 @@ Any _request error_ raised as a result of input coercion during
785792{CoerceArgumentValues()} should be treated instead as an _ execution error_ .
786793
787794Note: Variable values are not coerced because they are expected to be coerced
788- before executing the operation in {CoerceVariableValues()}, and valid operations
789- must only allow usage of variables of appropriate types.
795+ before processing the operation in {CoerceVariableValues()}, and valid
796+ operations must only allow usage of variables of appropriate types.
790797
791798### Value Resolution
792799
0 commit comments