Skip to content

Commit f16f52f

Browse files
committed
Revert to previous terminology and algorithm names.
1 parent 7bafeaf commit f16f52f

File tree

2 files changed

+41
-47
lines changed

2 files changed

+41
-47
lines changed

spec/Section 6 -- Execution.md

Lines changed: 38 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -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

2525
Implementations should not add additional properties to a _request_, which may
2626
conflict 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
3939
GraphQL document. Descriptions and comments on executable documents MAY be used
4040
for 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
4945
operation name to run if the document defines multiple operations, otherwise the
5046
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.
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
5551
concerns such as determining the operation and coercing the inputs, before
5652
passing the request on to the relevant algorithm for the operation's type which
5753
then performs any other necessary preliminary steps (for example establishing
@@ -65,18 +61,19 @@ error_, and once _execution_ begins will typically be an _execution error_.
6561
selection set_ through {ExecuteRootSelectionSet()}, and hence _execution_ begins
6662
when {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

8178
GetOperation(document, operationName):
8279

@@ -97,11 +94,11 @@ they should be reported in the list of "errors" in the response and the request
9794
must fail without execution.
9895

9996
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.
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

106103
For example: the document may be validated during development, provided it does
107104
not later change, or a service may validate a document once and memoize the
@@ -149,11 +146,7 @@ CoerceVariableValues(schema, operation, variableValues):
149146

150147
Note: 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

158151
The type system, as described in the "Type System" section of the spec, must
159152
provide 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
166159
executing the operation’s _root selection set_ with the query root operation
167160
type.
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
186179
side-effects on the underlying data system. Serial execution of the provided
187180
mutations 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
201194
executing the operation’s _root selection set_ for each new event on an
202195
underlying _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
205198
that 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
219212
Subscriptions at Scale.
220213

221214
As 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`
661655
before `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
664658
executed in serial order, starting with the first appearing field textually.
665659

666660
When executing a collected fields map serially, the executor must consider each

spec/Section 7 -- Response.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,9 @@ _request error result_ which will result in no response data.
129129
If an error was raised during _execution_ that prevented a valid response, the
130130
{"data"} entry in the response should be `null`.
131131

132-
Note: Request errors (including those raised during {Request()}) occur before
133-
_execution_ begins; when a request error is raised the {"data"} entry should not
134-
be present in the result.
132+
Note: Request errors (including those raised during {ExecuteRequest()}) occur
133+
before _execution_ begins; when a request error is raised the {"data"} entry
134+
should not be present in the result.
135135

136136
### Errors
137137

0 commit comments

Comments
 (0)