Skip to content

Commit c43d2f7

Browse files
authored
Editorial: Clarify field aliases (#843)
Factored out of #777. This clarifies the relationship between field aliases and response keys.
1 parent 29bcc26 commit c43d2f7

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

spec/Section 2 -- Language.md

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -453,11 +453,11 @@ These two queries are semantically identical:
453453

454454
Alias : Name :
455455

456-
By default, the key in the response object will use the field name
457-
queried. However, you can define a different name by specifying an alias.
456+
By default a field's response key in the response object will use that field's
457+
name. However, you can define a different response key by specifying an alias.
458458

459459
In this example, we can fetch two profile pictures of different sizes and ensure
460-
the resulting object will not have duplicate keys:
460+
the resulting response object will not have duplicate keys:
461461

462462
```graphql example
463463
{
@@ -470,7 +470,7 @@ the resulting object will not have duplicate keys:
470470
}
471471
```
472472

473-
Which returns the result:
473+
which returns the result:
474474

475475
```json example
476476
{
@@ -483,7 +483,7 @@ Which returns the result:
483483
}
484484
```
485485

486-
Since the top level of a query is a field, it also can be given an alias:
486+
The fields at the top level of an operation can also be given an alias:
487487

488488
```graphql example
489489
{
@@ -494,7 +494,7 @@ Since the top level of a query is a field, it also can be given an alias:
494494
}
495495
```
496496

497-
Returns the result:
497+
which returns the result:
498498

499499
```json example
500500
{
@@ -505,9 +505,6 @@ Returns the result:
505505
}
506506
```
507507

508-
A field's response key is its alias if an alias is provided, and it is
509-
otherwise the field's name.
510-
511508

512509
## Fragments
513510

0 commit comments

Comments
 (0)