Skip to content

Commit 17f1304

Browse files
committed
Merge branch 'main' into oneof-v2
2 parents dbccf84 + b41339a commit 17f1304

9 files changed

+152
-80
lines changed

CONTRIBUTING.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@ contributions.
66

77
Contributions that do not change the interpretation of the spec but instead
88
improve legibility, fix editorial errors, clear up ambiguity and improve
9-
examples are encouraged and are often merged by a spec editor with little
10-
process.
9+
examples are encouraged. These "editorial changes" will normally be given the
10+
["✏ Editorial" label](https://github.com/graphql/graphql-spec/issues?q=sort%3Aupdated-desc+is%3Aopen+label%3A%22%E2%9C%8F%EF%B8%8F+Editorial%22)
11+
and are often merged by a spec editor with little process.
1112

1213
However, contributions that _do_ meaningfully change the interpretation of the
1314
spec must follow an RFC (Request For Comments) process led by a _champion_

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
[![GraphQLConf 2024 Banner: September 10-12, San Francisco. Hosted by the GraphQL Foundation](https://github.com/user-attachments/assets/0203f10b-ae1e-4fe1-9222-6547fa2bbd5d)](https://graphql.org/conf/2024/?utm_source=github&utm_medium=graphql_spec&utm_campaign=readme)
2+
13
# GraphQL
24

35
<img alt="GraphQL Logo" align="right" src="https://graphql.org/img/logo.svg" width="15%" />

STYLE_GUIDE.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,3 +82,25 @@ MyAlgorithm(argOne, argTwo):
8282
- Let {something} be {true}.
8383
- Return {something}.
8484
```
85+
86+
## Definitions
87+
88+
For important terms, use
89+
[Spec Markdown definition paragraphs](https://spec-md.com/#sec-Definition-Paragraph).
90+
91+
Definition paragraphs start with `::` and add the matching italicized term to
92+
the [specification index](https://spec.graphql.org/draft/#index), making it easy
93+
to reference them.
94+
95+
## Tone of voice
96+
97+
The GraphQL specification is a reference document and should use neutral and
98+
descriptive tone of voice.
99+
100+
**Favor the present tense**
101+
102+
The present tense is usually clearer and shorter:
103+
104+
✅ Present: The client then sends a request to the server.
105+
106+
❌ Future: The client will then send a request to the server.

spec/Section 2 -- Language.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,8 +288,8 @@ There are three types of operations that GraphQL models:
288288

289289
- query - a read-only fetch.
290290
- mutation - a write followed by a fetch.
291-
- subscription - a long-lived request that fetches data in response to source
292-
events.
291+
- subscription - a long-lived request that fetches data in response to a
292+
sequence of events over time.
293293

294294
Each operation is represented by an optional operation name and a _selection
295295
set_.

spec/Section 3 -- Type System.md

Lines changed: 28 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ TypeSystemExtension :
4242
- TypeExtension
4343

4444
Type system extensions are used to represent a GraphQL type system which has
45-
been extended from some original type system. For example, this might be used by
45+
been extended from some previous type system. For example, this might be used by
4646
a local service to represent data a GraphQL client only accesses locally, or by
4747
a GraphQL service which is itself an extension of another GraphQL service.
4848

@@ -266,8 +266,8 @@ SchemaExtension :
266266
- extend schema Directives[Const]? { RootOperationTypeDefinition+ }
267267
- extend schema Directives[Const] [lookahead != `{`]
268268

269-
Schema extensions are used to represent a schema which has been extended from an
270-
original schema. For example, this might be used by a GraphQL service which adds
269+
Schema extensions are used to represent a schema which has been extended from a
270+
previous schema. For example, this might be used by a GraphQL service which adds
271271
additional operation types, or additional directives to an existing schema.
272272

273273
Note: Schema extensions without additional operation type definitions must not
@@ -279,7 +279,7 @@ The same limitation applies to the type definitions and extensions below.
279279
Schema extensions have the potential to be invalid if incorrectly defined.
280280

281281
1. The Schema must already be defined.
282-
2. Any non-repeatable directives provided must not already apply to the original
282+
2. Any non-repeatable directives provided must not already apply to the previous
283283
Schema.
284284

285285
## Types
@@ -377,7 +377,7 @@ TypeExtension :
377377
- InputObjectTypeExtension
378378

379379
Type extensions are used to represent a GraphQL type which has been extended
380-
from some original type. For example, this might be used by a local service to
380+
from some previous type. For example, this might be used by a local service to
381381
represent additional fields a GraphQL client only accesses locally.
382382

383383
## Scalars
@@ -640,15 +640,15 @@ ScalarTypeExtension :
640640
- extend scalar Name Directives[Const]
641641

642642
Scalar type extensions are used to represent a scalar type which has been
643-
extended from some original scalar type. For example, this might be used by a
643+
extended from some previous scalar type. For example, this might be used by a
644644
GraphQL tool or service which adds directives to an existing scalar.
645645

646646
**Type Validation**
647647

648648
Scalar type extensions have the potential to be invalid if incorrectly defined.
649649

650650
1. The named type must already be defined and must be a Scalar type.
651-
2. Any non-repeatable directives provided must not already apply to the original
651+
2. Any non-repeatable directives provided must not already apply to the previous
652652
Scalar type.
653653

654654
## Objects
@@ -1048,7 +1048,7 @@ ObjectTypeExtension :
10481048
- extend type Name ImplementsInterfaces [lookahead != `{`]
10491049

10501050
Object type extensions are used to represent a type which has been extended from
1051-
some original type. For example, this might be used to represent local data, or
1051+
some previous type. For example, this might be used to represent local data, or
10521052
by a GraphQL service which is itself an extension of another GraphQL service.
10531053

10541054
In this example, a local data field is added to a `Story` type:
@@ -1076,10 +1076,10 @@ Object type extensions have the potential to be invalid if incorrectly defined.
10761076
2. The fields of an Object type extension must have unique names; no two fields
10771077
may share the same name.
10781078
3. Any fields of an Object type extension must not be already defined on the
1079-
original Object type.
1080-
4. Any non-repeatable directives provided must not already apply to the original
1079+
previous Object type.
1080+
4. Any non-repeatable directives provided must not already apply to the previous
10811081
Object type.
1082-
5. Any interfaces provided must not be already implemented by the original
1082+
5. Any interfaces provided must not be already implemented by the previous
10831083
Object type.
10841084
6. The resulting extended object type must be a super-set of all interfaces it
10851085
implements.
@@ -1288,7 +1288,7 @@ InterfaceTypeExtension :
12881288
- extend interface Name ImplementsInterfaces [lookahead != `{`]
12891289

12901290
Interface type extensions are used to represent an interface which has been
1291-
extended from some original interface. For example, this might be used to
1291+
extended from some previous interface. For example, this might be used to
12921292
represent common local data on many types, or by a GraphQL service which is
12931293
itself an extension of another GraphQL service.
12941294

@@ -1328,11 +1328,11 @@ defined.
13281328
2. The fields of an Interface type extension must have unique names; no two
13291329
fields may share the same name.
13301330
3. Any fields of an Interface type extension must not be already defined on the
1331-
original Interface type.
1332-
4. Any Object or Interface type which implemented the original Interface type
1331+
previous Interface type.
1332+
4. Any Object or Interface type which implemented the previous Interface type
13331333
must also be a super-set of the fields of the Interface type extension (which
13341334
may be due to Object type extension).
1335-
5. Any non-repeatable directives provided must not already apply to the original
1335+
5. Any non-repeatable directives provided must not already apply to the previous
13361336
Interface type.
13371337
6. The resulting extended Interface type must be a super-set of all Interfaces
13381338
it implements.
@@ -1443,7 +1443,7 @@ UnionTypeExtension :
14431443
- extend union Name Directives[Const]
14441444

14451445
Union type extensions are used to represent a union type which has been extended
1446-
from some original union type. For example, this might be used to represent
1446+
from some previous union type. For example, this might be used to represent
14471447
additional local data, or by a GraphQL service which is itself an extension of
14481448
another GraphQL service.
14491449

@@ -1457,8 +1457,8 @@ Union type extensions have the potential to be invalid if incorrectly defined.
14571457
Similarly, wrapping types must not be member types of a Union.
14581458
3. All member types of a Union type extension must be unique.
14591459
4. All member types of a Union type extension must not already be a member of
1460-
the original Union type.
1461-
5. Any non-repeatable directives provided must not already apply to the original
1460+
the previous Union type.
1461+
5. Any non-repeatable directives provided must not already apply to the previous
14621462
Union type.
14631463

14641464
## Enums
@@ -1520,7 +1520,7 @@ EnumTypeExtension :
15201520
- extend enum Name Directives[Const] [lookahead != `{`]
15211521

15221522
Enum type extensions are used to represent an enum type which has been extended
1523-
from some original enum type. For example, this might be used to represent
1523+
from some previous enum type. For example, this might be used to represent
15241524
additional local data, or by a GraphQL service which is itself an extension of
15251525
another GraphQL service.
15261526

@@ -1531,8 +1531,8 @@ Enum type extensions have the potential to be invalid if incorrectly defined.
15311531
1. The named type must already be defined and must be an Enum type.
15321532
2. All values of an Enum type extension must be unique.
15331533
3. All values of an Enum type extension must not already be a value of the
1534-
original Enum.
1535-
4. Any non-repeatable directives provided must not already apply to the original
1534+
previous Enum.
1535+
4. Any non-repeatable directives provided must not already apply to the previous
15361536
Enum type.
15371537

15381538
## Input Objects
@@ -1792,7 +1792,7 @@ InputObjectTypeExtension :
17921792
- extend input Name Directives[Const] [lookahead != `{`]
17931793

17941794
Input object type extensions are used to represent an input object type which
1795-
has been extended from some original input object type. For example, this might
1795+
has been extended from some previous input object type. For example, this might
17961796
be used by a GraphQL service which is itself an extension of another GraphQL
17971797
service.
17981798

@@ -1804,8 +1804,8 @@ defined.
18041804
1. The named type must already be defined and must be a Input Object type.
18051805
2. All fields of an Input Object type extension must have unique names.
18061806
3. All fields of an Input Object type extension must not already be a field of
1807-
the original Input Object.
1808-
4. Any non-repeatable directives provided must not already apply to the original
1807+
the previous Input Object.
1808+
4. Any non-repeatable directives provided must not already apply to the previous
18091809
Input Object type.
18101810
5. The `@oneOf` directive must not be provided by an Input Object type
18111811
extension.
@@ -1866,7 +1866,9 @@ Following are examples of input coercion with various list types and values:
18661866
| `[Int]` | `1` | `[1]` |
18671867
| `[Int]` | `null` | `null` |
18681868
| `[[Int]]` | `[[1], [2, 3]]` | `[[1], [2, 3]]` |
1869-
| `[[Int]]` | `[1, 2, 3]` | Error: Incorrect item value |
1869+
| `[[Int]]` | `[1, 2, 3]` | `[[1], [2], [3]]` |
1870+
| `[[Int]]` | `[1, null, 3]` | `[[1], null, [3]]` |
1871+
| `[[Int]]` | `[[1], ["b"]]` | Error: Incorrect item value |
18701872
| `[[Int]]` | `1` | `[[1]]` |
18711873
| `[[Int]]` | `null` | `null` |
18721874

@@ -2188,7 +2190,7 @@ condition is false.
21882190

21892191
```graphql
21902192
directive @deprecated(
2191-
reason: String = "No longer supported"
2193+
reason: String! = "No longer supported"
21922194
) on FIELD_DEFINITION | ARGUMENT_DEFINITION | INPUT_FIELD_DEFINITION | ENUM_VALUE
21932195
```
21942196

spec/Section 4 -- Introspection.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ CommonMark-compliant Markdown renderer.
110110

111111
To support the management of backwards compatibility, GraphQL fields, arguments,
112112
input fields, and enum values can indicate whether or not they are deprecated
113-
(`isDeprecated: Boolean`) along with a description of why it is deprecated
113+
(`isDeprecated: Boolean!`) along with a description of why it is deprecated
114114
(`deprecationReason: String`).
115115

116116
Tools built using GraphQL introspection should respect deprecation by
@@ -428,7 +428,8 @@ Fields\:
428428
this field.
429429
- `isDeprecated` returns {true} if this field should no longer be used,
430430
otherwise {false}.
431-
- `deprecationReason` optionally provides a reason why this field is deprecated.
431+
- `deprecationReason` returns the reason why this field is deprecated, or null
432+
if this field is not deprecated.
432433

433434
### The \_\_InputValue Type
434435

@@ -446,8 +447,8 @@ Fields\:
446447
provided at runtime. If this input value has no default value, returns {null}.
447448
- `isDeprecated` returns {true} if this input field or argument should no longer
448449
be used, otherwise {false}.
449-
- `deprecationReason` optionally provides a reason why this input field or
450-
argument is deprecated.
450+
- `deprecationReason` returns the reason why this input field or argument is
451+
deprecated, or null if the input field or argument is not deprecated.
451452

452453
### The \_\_EnumValue Type
453454

@@ -459,8 +460,8 @@ Fields\:
459460
- `description` may return a String or {null}.
460461
- `isDeprecated` returns {true} if this enum value should no longer be used,
461462
otherwise {false}.
462-
- `deprecationReason` optionally provides a reason why this enum value is
463-
deprecated.
463+
- `deprecationReason` returns the reason why this enum value is deprecated, or
464+
null if the enum value is not deprecated.
464465

465466
### The \_\_Directive Type
466467

spec/Section 5 -- Validation.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ FieldsInSetCanMerge(set):
442442

443443
- Let {fieldsForName} be the set of selections with a given response name in
444444
{set} including visiting fragments and inline fragments.
445-
- Given each pair of members {fieldA} and {fieldB} in {fieldsForName}:
445+
- Given each pair of distinct members {fieldA} and {fieldB} in {fieldsForName}:
446446
- {SameResponseShape(fieldA, fieldB)} must be true.
447447
- If the parent types of {fieldA} and {fieldB} are equal or if either is not
448448
an Object Type:
@@ -474,7 +474,8 @@ SameResponseShape(fieldA, fieldB):
474474
selection set of {fieldB}.
475475
- Let {fieldsForName} be the set of selections with a given response name in
476476
{mergedSet} including visiting fragments and inline fragments.
477-
- Given each pair of members {subfieldA} and {subfieldB} in {fieldsForName}:
477+
- Given each pair of distinct members {subfieldA} and {subfieldB} in
478+
{fieldsForName}:
478479
- If {SameResponseShape(subfieldA, subfieldB)} is {false}, return {false}.
479480
- Return {true}.
480481

0 commit comments

Comments
 (0)