Skip to content

Commit e53860e

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

File tree

1 file changed

+38
-36
lines changed

1 file changed

+38
-36
lines changed

spec/Section 6 -- Execution.md

Lines changed: 38 additions & 36 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,19 @@ 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

4444
<a name="#sec-Executing-Requests">
4545
<!-- Legacy link, this section was previously titled "Executing Requests" -->
4646
</a>
4747

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
4949
operation name to run if the document defines multiple operations, otherwise the
5050
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.
5353

54-
The {Request()} algorithm contains the preamble for _execution_, handling
54+
The {ExecuteRequest()} algorithm contains the preamble for _execution_, handling
5555
concerns such as determining the operation and coercing the inputs, before
5656
passing the request on to the relevant algorithm for the operation's type which
5757
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_.
6565
selection set_ through {ExecuteRootSelectionSet()}, and hence _execution_ begins
6666
when {ExecuteRootSelectionSet()} is called for the first time in a request.
6767

68-
Request(schema, document, operationName, variableValues, initialValue):
68+
ExecuteRequest(schema, document, operationName, variableValues, initialValue):
6969

7070
- Let {operation} be the result of {GetOperation(document, operationName)}.
7171
- Let {coercedVariableValues} be the result of {CoerceVariableValues(schema,
7272
operation, variableValues)}.
7373
- If {operation} is a query operation:
74-
- Return {Query(operation, schema, coercedVariableValues, initialValue)}.
74+
- Return {ExecuteQuery(operation, schema, coercedVariableValues,
75+
initialValue)}.
7576
- 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,
7978
initialValue)}.
79+
- Otherwise if {operation} is a subscription operation:
80+
- Return {Subscribe(operation, schema, coercedVariableValues, initialValue)}.
8081

8182
GetOperation(document, operationName):
8283

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

99100
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.
105106

106107
For example: the document may be validated during development, provided it does
107108
not later change, or a service may validate a document once and memoize the
@@ -149,7 +150,7 @@ CoerceVariableValues(schema, operation, variableValues):
149150

150151
Note: This algorithm is very similar to {CoerceArgumentValues()}.
151152

152-
## Performing Operations
153+
## Executing Operations
153154

154155
<a name="#sec-Executing-Operations">
155156
<!-- 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
166167
executing the operation’s _root selection set_ with the query root operation
167168
type.
168169

169-
An initial value may be provided when performing a query operation.
170+
An initial value may be provided when executing a query operation.
170171

171-
Query(query, schema, variableValues, initialValue):
172+
ExecuteQuery(query, schema, variableValues, initialValue):
172173

173174
- Let {queryType} be the root Query type in {schema}.
174175
- Assert: {queryType} is an Object type.
@@ -186,7 +187,7 @@ It is expected that the top level fields in a mutation operation perform
186187
side-effects on the underlying data system. Serial execution of the provided
187188
mutations ensures against race conditions during these side-effects.
188189

189-
Mutation(mutation, schema, variableValues, initialValue):
190+
ExecuteMutation(mutation, schema, variableValues, initialValue):
190191

191192
- Let {mutationType} be the root Mutation type in {schema}.
192193
- Assert: {mutationType} is an Object type.
@@ -201,10 +202,10 @@ _response stream_ where each event in the event stream is the result of
201202
executing the operation’s _root selection set_ for each new event on an
202203
underlying _source stream_.
203204

204-
Performing a subscription operation creates a persistent function on the service
205+
Executing a subscription operation creates a persistent function on the service
205206
that maps an underlying _source stream_ to a returned _response stream_.
206207

207-
Subscription(subscription, schema, variableValues, initialValue):
208+
Subscribe(subscription, schema, variableValues, initialValue):
208209

209210
- Let {sourceStream} be the result of running
210211
{CreateSourceEventStream(subscription, schema, variableValues, initialValue)}.
@@ -213,9 +214,9 @@ Subscription(subscription, schema, variableValues, initialValue):
213214
variableValues)}.
214215
- Return {responseStream}.
215216

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
219220
Subscriptions at Scale.
220221

221222
As an example, consider a chat application. To subscribe to new messages posted
@@ -336,7 +337,8 @@ MapSourceToResponseEvent(sourceStream, subscription, schema, variableValues):
336337
- Let {responseStream} be a new _event stream_.
337338
- When {sourceStream} emits {sourceValue}:
338339
- Let {executionResult} be the result of running
339-
{SubscriptionEvent(subscription, schema, variableValues, sourceValue)}.
340+
{ExecuteSubscriptionEvent(subscription, schema, variableValues,
341+
sourceValue)}.
340342
- If internal {error} was raised:
341343
- Cancel {sourceStream}.
342344
- Complete {responseStream} with {error}.
@@ -350,21 +352,21 @@ MapSourceToResponseEvent(sourceStream, subscription, schema, variableValues):
350352
- Complete {responseStream} normally.
351353
- Return {responseStream}.
352354

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

358-
SubscriptionEvent(subscription, schema, variableValues, initialValue):
360+
ExecuteSubscriptionEvent(subscription, schema, variableValues, initialValue):
359361

360362
- Let {subscriptionType} be the root Subscription type in {schema}.
361363
- Assert: {subscriptionType} is an Object type.
362364
- Let {rootSelectionSet} be the _root selection set_ in {subscription}.
363365
- Return {ExecuteRootSelectionSet(variableValues, initialValue,
364366
subscriptionType, rootSelectionSet, "normal")}.
365367

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

369371
#### Unsubscribe
370372

@@ -660,7 +662,7 @@ A valid GraphQL executor can resolve the four fields in whatever order it chose
660662
(however of course `birthday` must be resolved before `month`, and `address`
661663
before `street`).
662664

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
664666
executed in serial order, starting with the first appearing field textually.
665667

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

0 commit comments

Comments
 (0)