@@ -18,9 +18,9 @@ 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 {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.
2424
2525Implementations should not add additional properties to a _ request_ , which may
2626conflict with future editions of the GraphQL specification. Instead,
@@ -39,19 +39,15 @@ and have no effect on the observable execution, validation, or response of a
3939GraphQL document. Descriptions and comments on executable documents MAY be used
4040for non-observable purposes, such as logging and other developer tools.
4141
42- ## Processing Requests
42+ ## Executing Requests
4343
44- <a name =" #sec-Executing-Requests " >
45- <!-- Legacy link, this section was previously titled "Executing Requests" -->
46- </a >
47-
48- To process a request, the executor must have a parsed {Document} and a selected
44+ To execute a request, the executor must have a parsed {Document} and a selected
4945operation name to run if the document defines multiple operations, otherwise the
5046document 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.
47+ request is determined by the result of executing this operation according to the
48+ "Executing Operations” section below.
5349
54- The {Request ()} algorithm contains the preamble for _ execution_ , handling
50+ The {ExecuteRequest ()} algorithm contains the preamble for _ execution_ , handling
5551concerns such as determining the operation and coercing the inputs, before
5652passing the request on to the relevant algorithm for the operation's type which
5753then performs any other necessary preliminary steps (for example establishing
@@ -65,18 +61,19 @@ error_, and once _execution_ begins will typically be an _execution error_.
6561selection set_ through {ExecuteRootSelectionSet()}, and hence _ execution_ begins
6662when {ExecuteRootSelectionSet()} is called for the first time in a request.
6763
68- Request (schema, document, operationName, variableValues, initialValue):
64+ ExecuteRequest (schema, document, operationName, variableValues, initialValue):
6965
7066- Let {operation} be the result of {GetOperation(document, operationName)}.
7167- Let {coercedVariableValues} be the result of {CoerceVariableValues(schema,
7268 operation, variableValues)}.
7369- If {operation} is a query operation:
74- - Return {Query(operation, schema, coercedVariableValues, initialValue)}.
70+ - Return {ExecuteQuery(operation, schema, coercedVariableValues,
71+ initialValue)}.
7572- 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,
73+ - Return {ExecuteMutation(operation, schema, coercedVariableValues,
7974 initialValue)}.
75+ - Otherwise if {operation} is a subscription operation:
76+ - Return {Subscribe(operation, schema, coercedVariableValues, initialValue)}.
8077
8178GetOperation(document, operationName):
8279
@@ -97,11 +94,11 @@ they should be reported in the list of "errors" in the response and the request
9794must fail without execution.
9895
9996Typically 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.
97+ calling {ExecuteRequest ()}, however a GraphQL service may execute a request
98+ without immediately validating the document if that exact same document is known
99+ to have been validated before. A GraphQL service should only execute operations
100+ which _ at some point_ were known to be free of any validation errors, and have
101+ since not changed.
105102
106103For example: the document may be validated during development, provided it does
107104not later change, or a service may validate a document once and memoize the
@@ -149,11 +146,7 @@ CoerceVariableValues(schema, operation, variableValues):
149146
150147Note: This algorithm is very similar to {CoerceArgumentValues()}.
151148
152- ## Performing Operations
153-
154- <a name =" #sec-Executing-Operations " >
155- <!-- Legacy link, this section was previously titled "Executing Operations" -->
156- </a >
149+ ## Executing Operations
157150
158151The type system, as described in the "Type System" section of the spec, must
159152provide a query root operation type. If mutations or subscriptions are
@@ -166,9 +159,9 @@ If the operation is a query, the result of the operation is the result of
166159executing the operation’s _ root selection set_ with the query root operation
167160type.
168161
169- An initial value may be provided when performing a query operation.
162+ An initial value may be provided when executing a query operation.
170163
171- Query (query, schema, variableValues, initialValue):
164+ ExecuteQuery (query, schema, variableValues, initialValue):
172165
173166- Let {queryType} be the root Query type in {schema}.
174167- Assert: {queryType} is an Object type.
@@ -186,7 +179,7 @@ It is expected that the top level fields in a mutation operation perform
186179side-effects on the underlying data system. Serial execution of the provided
187180mutations ensures against race conditions during these side-effects.
188181
189- Mutation (mutation, schema, variableValues, initialValue):
182+ ExecuteMutation (mutation, schema, variableValues, initialValue):
190183
191184- Let {mutationType} be the root Mutation type in {schema}.
192185- Assert: {mutationType} is an Object type.
@@ -201,10 +194,10 @@ _response stream_ where each event in the event stream is the result of
201194executing the operation’s _ root selection set_ for each new event on an
202195underlying _ source stream_ .
203196
204- Performing a subscription operation creates a persistent function on the service
197+ Executing a subscription operation creates a persistent function on the service
205198that maps an underlying _ source stream_ to a returned _ response stream_ .
206199
207- Subscription (subscription, schema, variableValues, initialValue):
200+ Subscribe (subscription, schema, variableValues, initialValue):
208201
209202- Let {sourceStream} be the result of running
210203 {CreateSourceEventStream(subscription, schema, variableValues, initialValue)}.
@@ -213,9 +206,9 @@ Subscription(subscription, schema, variableValues, initialValue):
213206 variableValues)}.
214207- Return {responseStream}.
215208
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
209+ Note: In a large-scale subscription system, the {Subscribe ()} and
210+ {ExecuteSubscriptionEvent ()} algorithms may be run on separate services to
211+ maintain predictable scaling properties. See the section below on Supporting
219212Subscriptions at Scale.
220213
221214As an example, consider a chat application. To subscribe to new messages posted
@@ -336,7 +329,8 @@ MapSourceToResponseEvent(sourceStream, subscription, schema, variableValues):
336329- Let {responseStream} be a new _ event stream_ .
337330- When {sourceStream} emits {sourceValue}:
338331 - Let {executionResult} be the result of running
339- {SubscriptionEvent(subscription, schema, variableValues, sourceValue)}.
332+ {ExecuteSubscriptionEvent(subscription, schema, variableValues,
333+ sourceValue)}.
340334 - If internal {error} was raised:
341335 - Cancel {sourceStream}.
342336 - Complete {responseStream} with {error}.
@@ -350,21 +344,21 @@ MapSourceToResponseEvent(sourceStream, subscription, schema, variableValues):
350344 - Complete {responseStream} normally.
351345- Return {responseStream}.
352346
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.
347+ Note: Since {ExecuteSubscriptionEvent ()} handles all _ execution error_ , and
348+ _ request error_ only occur during {CreateSourceEventStream()}, the only
349+ remaining error condition handled from {ExecuteSubscriptionEvent ()} are internal
350+ exceptional errors not described by this specification.
357351
358- SubscriptionEvent (subscription, schema, variableValues, initialValue):
352+ ExecuteSubscriptionEvent (subscription, schema, variableValues, initialValue):
359353
360354- Let {subscriptionType} be the root Subscription type in {schema}.
361355- Assert: {subscriptionType} is an Object type.
362356- Let {rootSelectionSet} be the _ root selection set_ in {subscription}.
363357- Return {ExecuteRootSelectionSet(variableValues, initialValue,
364358 subscriptionType, rootSelectionSet, "normal")}.
365359
366- Note: The {SubscriptionEvent ()} algorithm is intentionally similar to {Query()}
367- since this is how each event result is produced.
360+ Note: The {ExecuteSubscriptionEvent ()} algorithm is intentionally similar to
361+ {ExecuteQuery()} since this is how each event result is produced.
368362
369363#### Unsubscribe
370364
@@ -660,7 +654,7 @@ A valid GraphQL executor can resolve the four fields in whatever order it chose
660654(however of course ` birthday ` must be resolved before ` month ` , and ` address `
661655before ` street ` ).
662656
663- When performing a mutation, the selections in the top most selection set will be
657+ When executing a mutation, the selections in the top most selection set will be
664658executed in serial order, starting with the first appearing field textually.
665659
666660When executing a collected fields map serially, the executor must consider each
0 commit comments