Skip to content

Commit a6a8e91

Browse files
committed
fixes based on Benji's feedback - reversed several fixes to discuss them separately
1 parent 40cf144 commit a6a8e91

5 files changed

Lines changed: 30 additions & 22 deletions

File tree

spec/Section 2 -- Language.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1172,8 +1172,8 @@ VariableDefinition : Variable : Type DefaultValue? Directives[Const]?
11721172

11731173
DefaultValue : = Value[Const]
11741174

1175-
A GraphQL operation can be parameterized with variables
1176-
maximizing reuse of parsed queries by the GraphQL service.
1175+
A GraphQL operation can be parameterized with variables, maximizing reuse, and
1176+
avoiding costly string building in clients at runtime.
11771177

11781178
If not defined as constant (for example, in {DefaultValue}), a {Variable} can be
11791179
supplied for an input value.

spec/Section 3 -- Type System.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,14 @@ system definition language can omit the schema definition when the {`query`},
216216
{`mutation`}, and {`subscription`} root types are named {"Query"}, {"Mutation"},
217217
and {"Subscription"} respectively.
218218

219+
Likewise, when representing a GraphQL schema using the type system definition
220+
language, a schema definition should be omitted if it only uses the default root
221+
operation type names.
222+
223+
Likewise, when representing a GraphQL schema using the type system definition
224+
language, a schema definition should be omitted if it only uses the default root
225+
operation type names.
226+
219227
This example describes a valid complete GraphQL schema, despite not explicitly
220228
including a {`schema`} definition. The {"Query"} type is presumed to be the
221229
{`query`} root operation type of the schema.
@@ -850,9 +858,8 @@ Produces the ordered result:
850858

851859
**Result Coercion**
852860

853-
Determining the result of coercing an object is a part of the GraphQL request execution,
854-
so this is covered in the [Coercing Results](#sec-Value-Completion.Coercing-Results)
855-
section within the Execution section.
861+
Determining the result of coercing an object is the heart of the GraphQL
862+
executor, so this is covered in that section of the spec.
856863

857864
**Input Coercion**
858865

spec/Section 5 -- Validation.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -574,16 +574,16 @@ fragment conflictingDifferingResponses on Pet {
574574
**Formal Specification**
575575

576576
- For each {selection} in the document:
577-
- Let {selectionType} be the result type of {selection}.
578-
- If {selectionType} is a scalar, enum or list of those types:
577+
- Let {selectionType} be the unwrapped result type of {selection}.
578+
- If {selectionType} is a scalar or enum:
579579
- The subselection set of that selection must be empty.
580580
- If {selectionType} is an interface, union, object or list of those types:
581581
- The subselection set of that selection must NOT BE empty.
582582

583583
**Explanatory Text**
584584

585-
Field selections on scalars, enums or list of those types are never allowed, because they are the
586-
leaf nodes of any GraphQL operation.
585+
Scalars and enums are the underlying type of leaf nodes of any GraphQL
586+
operation. Field selections are never allowed on leaf nodes.
587587

588588
The following is valid.
589589

@@ -603,9 +603,9 @@ fragment scalarSelectionsNotAllowedOnInt on Dog {
603603
}
604604
```
605605

606-
Conversely the leaf field selections of GraphQL operations must be of type
607-
scalar, enum, or list of those types. Leaf selections on objects, interfaces, unions
608-
or list of those types without subfields are disallowed.
606+
Conversely the underlying type of leaf field selections of GraphQL operations
607+
must be scalar or enum. Leaf selections without subfields on fields whose
608+
underlying type is object, interface, or union are disallowed.
609609

610610
Let's assume the following additions to the query root operation type of the
611611
schema:

spec/Section 6 -- Execution.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ must receive no more events from that event stream.
221221

222222
**Supporting Subscriptions at Scale**
223223

224-
Supporting subscriptions is a significant challenge for a GraphQL service. Query
224+
Supporting subscriptions is a significant change for any GraphQL service. Query
225225
and mutation operations are stateless, allowing scaling via cloning of GraphQL
226226
service instances. Subscriptions, by contrast, are stateful and require
227227
maintaining the GraphQL document, variables, and other context over the lifetime
@@ -235,12 +235,12 @@ connectivity.
235235
**Delivery Agnostic**
236236

237237
GraphQL subscriptions do not require any specific serialization format or
238-
transport mechanism. Subscriptions specify parameters for the creation of a
239-
stream, the content of each payload on that stream, and the closing of that
240-
stream. There are intentionally no specifications for message acknowledgement,
241-
buffering, resend requests, or any other quality of service (QoS) details.
242-
Message serialization, transport mechanisms, and quality of service details
243-
should be chosen by the implementing service.
238+
transport mechanism. GraphQL specifies algorithms for the creation of a
239+
subscription stream, the content of each payload on that stream, and the closing
240+
of that stream. There are intentionally no specifications for message
241+
acknowledgement, buffering, resend requests, or any other quality of service
242+
(QoS) details. Message serialization, transport mechanisms, and quality of
243+
service details should be chosen by the implementing service.
244244

245245
#### Source Stream
246246

@@ -395,7 +395,7 @@ completion before it continues on to the next item in the grouped field set:
395395
For example, given the following selection set to be executed serially:
396396

397397
```graphql example
398-
mutation {
398+
{
399399
changeBirthday(birthday: $newBirthday) {
400400
month
401401
}
@@ -417,7 +417,7 @@ As an illustrative example, let's assume we have a mutation field
417417
we execute the following selection set serially:
418418

419419
```graphql example
420-
mutation {
420+
{
421421
first: changeTheNumber(newNumber: 1) {
422422
theNumber
423423
}

spec/Section 7 -- Response.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ contains should indicate why no data was able to be returned.
6161

6262
If the `data` entry in the response is present (including if it is the value
6363
{null}), the `errors` entry in the response may contain any field errors that
64-
were raised during execution.
64+
were raised during execution. If field errors were raised during execution, it
65+
should contain those errors.
6566

6667
**Request Errors**
6768

0 commit comments

Comments
 (0)