Skip to content

Commit 4905977

Browse files
committed
- Add PR feedback
- remove extraneous examples - tighten up wording
1 parent 6456c5f commit 4905977

File tree

1 file changed

+19
-9
lines changed

1 file changed

+19
-9
lines changed

spec/Section 3 -- Type System.md

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,8 @@ Schema extensions have the potential to be invalid if incorrectly defined.
284284

285285
### Schema Coordinates
286286

287-
Schema Coordinates are human readable strings that uniquely identify an element defined in a GraphQL Schema.
287+
Schema Coordinates are human readable strings that uniquely identify a specific
288+
type, field, argument, enum value, or directive defined in a GraphQL Schema.
288289

289290
**Definition**
290291

@@ -295,6 +296,12 @@ SchemaCoordinate:
295296
- @ Name
296297
- @ Name ( Name : )
297298

299+
Note: The `SchemaCoordinate` syntax is not part of a GraphQL Document. Schema
300+
Coordinates are a separate syntax, intended to be used by tooling when
301+
referencing types and fields or other schema elements. (For example, a server
302+
that wishes to keep track of the number of times fields have been accessed may
303+
use their Schema Coordinate as the lookup key.)
304+
298305
**Semantics**
299306

300307
SchemaCoordinate: Name
@@ -338,7 +345,8 @@ SchemaCoordinate: @ Name ( Name : )
338345

339346
**Examples**
340347

341-
This section shows example coordinates for the possible schema element types this syntax covers.
348+
This section shows example coordinates for the possible schema element types
349+
this syntax covers.
342350

343351
All examples below will assume the following schema:
344352

@@ -398,16 +406,14 @@ type Mutation {
398406
}
399407
```
400408

401-
The following table demonstrates how to select various kinds of schema members:
409+
The following table shows examples of Schema Coordinates for elements in the
410+
schema above:
402411

403412
| Schema Coordinate | Description |
404413
| ------------------------------ | ------------------------------------------------------------------- |
405414
| `Business` | `Business` type |
406-
| `User` | `User` type |
407-
| `Business.name` | `name` field on the `Business` type |
408415
| `User.name` | `name` field on the `User` type |
409416
| `Query.searchBusiness(name:)` | `name` argument on the `searchBusiness` field on the `Query` type |
410-
| `Query.searchBusiness(filter:)`| `filter` argument on the `searchBusiness` field on the `Query` type |
411417
| `SearchFilter` | `SearchFilter` enum |
412418
| `SearchFilter.OPEN_NOW` | `OPEN_NOW` value of the`SearchFilter` enum |
413419
| `@private` | `@private` directive definition |
@@ -420,15 +426,19 @@ The following table demonstrates how to select various kinds of schema members:
420426
| `DateTime` | Custom `DateTime` scalar type |
421427
| `String` | Built-in `String` scalar type |
422428

423-
Note: You may not select members inside a union definition.
429+
Schema Coordinates are always unique. Each type, field, argument, enum value, or
430+
directive may be referenced by exactly one possible Schema Coordinate.
424431

425-
The following counter example is *not* considered a valid Schema Coordinate:
432+
For example, the following is *not* a valid Schema Coordinate:
426433

427434
```graphql counter-example
428435
Entity.Business
429436
```
430437

431-
In such cases, you may wish to select the type directly instead (e.g. `Business`).
438+
In this counter example, both `Entity.Business` and `Business` would refer to
439+
the `Business` type. Since it would be ambiguous what the "primary key" should
440+
be in an application that uses Schema Coordinates to reference types, this is
441+
not allowed.
432442

433443
## Types
434444

0 commit comments

Comments
 (0)