@@ -121,16 +121,16 @@ respectively.
121
121
### Query
122
122
123
123
If the operation is a query, the result of the operation is the result of
124
- executing the operation’s top level selection set with the query root operation
125
- type.
124
+ executing the operation’s top level _ selection set _ with the query root
125
+ operation type.
126
126
127
127
An initial value may be provided when executing a query operation.
128
128
129
129
ExecuteQuery(query, schema, variableValues, initialValue):
130
130
131
131
- Let {queryType} be the root Query type in {schema}.
132
132
- Assert: {queryType} is an Object type.
133
- - Let {selectionSet} be the top level Selection Set in {query}.
133
+ - Let {selectionSet} be the top level selection set in {query}.
134
134
- Let {data} be the result of running {ExecuteSelectionSet(selectionSet,
135
135
queryType, initialValue, variableValues)} _ normally_ (allowing
136
136
parallelization).
@@ -141,7 +141,7 @@ ExecuteQuery(query, schema, variableValues, initialValue):
141
141
### Mutation
142
142
143
143
If the operation is a mutation, the result of the operation is the result of
144
- executing the operation’s top level selection set on the mutation root object
144
+ executing the operation’s top level _ selection set _ on the mutation root object
145
145
type. This selection set should be executed serially.
146
146
147
147
It is expected that the top level fields in a mutation operation perform
@@ -152,7 +152,7 @@ ExecuteMutation(mutation, schema, variableValues, initialValue):
152
152
153
153
- Let {mutationType} be the root Mutation type in {schema}.
154
154
- Assert: {mutationType} is an Object type.
155
- - Let {selectionSet} be the top level Selection Set in {mutation}.
155
+ - Let {selectionSet} be the top level selection set in {mutation}.
156
156
- Let {data} be the result of running {ExecuteSelectionSet(selectionSet,
157
157
mutationType, initialValue, variableValues)} _ serially_ .
158
158
- Let {errors} be the list of all _ field error_ raised while executing the
@@ -255,7 +255,7 @@ CreateSourceEventStream(subscription, schema, variableValues, initialValue):
255
255
256
256
- Let {subscriptionType} be the root Subscription type in {schema}.
257
257
- Assert: {subscriptionType} is an Object type.
258
- - Let {selectionSet} be the top level Selection Set in {subscription}.
258
+ - Let {selectionSet} be the top level selection set in {subscription}.
259
259
- Let {groupedFieldSet} be the result of {CollectFields(subscriptionType,
260
260
selectionSet, variableValues)}.
261
261
- If {groupedFieldSet} does not have exactly one entry, raise a _ request error_ .
@@ -285,7 +285,7 @@ operation type.
285
285
#### Response Stream
286
286
287
287
Each event in the underlying Source Stream triggers execution of the
288
- subscription selection set using that event as a root value.
288
+ subscription _ selection set _ using that event as a root value.
289
289
290
290
MapSourceToResponseEvent(sourceStream, subscription, schema, variableValues):
291
291
@@ -300,7 +300,7 @@ ExecuteSubscriptionEvent(subscription, schema, variableValues, initialValue):
300
300
301
301
- Let {subscriptionType} be the root Subscription type in {schema}.
302
302
- Assert: {subscriptionType} is an Object type.
303
- - Let {selectionSet} be the top level Selection Set in {subscription}.
303
+ - Let {selectionSet} be the top level selection set in {subscription}.
304
304
- Let {data} be the result of running {ExecuteSelectionSet(selectionSet,
305
305
subscriptionType, initialValue, variableValues)} _ normally_ (allowing
306
306
parallelization).
@@ -324,9 +324,9 @@ Unsubscribe(responseStream):
324
324
325
325
## Executing Selection Sets
326
326
327
- To execute a selection set , the object value being evaluated and the object type
328
- need to be known, as well as whether it must be executed serially, or may be
329
- executed in parallel.
327
+ To execute a _ selection set _ , the object value being evaluated and the object
328
+ type need to be known, as well as whether it must be executed serially, or may
329
+ be executed in parallel.
330
330
331
331
First, the selection set is turned into a grouped field set; then, each
332
332
represented field in the grouped field set produces an entry into a response
@@ -396,10 +396,11 @@ entry from the grouped field set in the order provided in the grouped field set.
396
396
It must determine the corresponding entry in the result map for each item to
397
397
completion before it continues on to the next item in the grouped field set:
398
398
399
- For example, given the following selection set to be executed serially:
399
+ For example, given the following mutation operation, the root _ selection set_
400
+ must be executed serially:
400
401
401
402
``` graphql example
402
- {
403
+ mutation ChangeBirthdayAndAddress ( $newBirthday : String ! , $newAddress : String ! ) {
403
404
changeBirthday (birthday : $newBirthday ) {
404
405
month
405
406
}
@@ -409,7 +410,7 @@ For example, given the following selection set to be executed serially:
409
410
}
410
411
```
411
412
412
- The executor must, in serial:
413
+ Therefore the executor must, in serial:
413
414
414
415
- Run {ExecuteField()} for ` changeBirthday ` , which during {CompleteValue()} will
415
416
execute the ` { month } ` sub-selection set normally.
@@ -418,9 +419,10 @@ The executor must, in serial:
418
419
419
420
As an illustrative example, let's assume we have a mutation field
420
421
` changeTheNumber ` that returns an object containing one field, ` theNumber ` . If
421
- we execute the following selection set serially:
422
+ we execute the following _ selection set _ serially:
422
423
423
424
``` graphql example
425
+ # Note: This is a selection set, not a full document using the query shorthand.
424
426
{
425
427
first : changeTheNumber (newNumber : 1 ) {
426
428
theNumber
@@ -443,7 +445,7 @@ The executor will execute the following serially:
443
445
- Resolve the ` changeTheNumber(newNumber: 2) ` field
444
446
- Execute the ` { theNumber } ` sub-selection set of ` third ` normally
445
447
446
- A correct executor must generate the following result for that selection set :
448
+ A correct executor must generate the following result for that _ selection set _ :
447
449
448
450
``` json example
449
451
{
@@ -461,7 +463,7 @@ A correct executor must generate the following result for that selection set:
461
463
462
464
### Field Collection
463
465
464
- Before execution, the selection set is converted to a grouped field set by
466
+ Before execution, the _ selection set _ is converted to a grouped field set by
465
467
calling {CollectFields()}. Each entry in the grouped field set is a list of
466
468
fields that share a response key (the alias if defined, otherwise the field
467
469
name). This ensures all fields with the same response key (including those in
@@ -740,9 +742,9 @@ ResolveAbstractType(abstractType, objectValue):
740
742
741
743
** Merging Selection Sets**
742
744
743
- When more than one field of the same name is executed in parallel, their
744
- selection sets are merged together when completing the value in order to
745
- continue execution of the sub-selection sets.
745
+ When more than one field of the same name is executed in parallel, the
746
+ _ selection set _ for each of the fields are merged together when completing the
747
+ value in order to continue execution of the sub-selection sets.
746
748
747
749
An example operation illustrating parallel fields with the same name with
748
750
sub-selections.
0 commit comments