Skip to content

Commit 50ae66a

Browse files
magicmarkleebyron
authored andcommitted
- Add PR feedback
- remove extraneous examples - tighten up wording
1 parent 856cd6e commit 50ae66a

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
@@ -253,7 +253,8 @@ Schema extensions have the potential to be invalid if incorrectly defined.
253253

254254
### Schema Coordinates
255255

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

258259
**Definition**
259260

@@ -264,6 +265,12 @@ SchemaCoordinate:
264265
- @ Name
265266
- @ Name ( Name : )
266267

268+
Note: The `SchemaCoordinate` syntax is not part of a GraphQL Document. Schema
269+
Coordinates are a separate syntax, intended to be used by tooling when
270+
referencing types and fields or other schema elements. (For example, a server
271+
that wishes to keep track of the number of times fields have been accessed may
272+
use their Schema Coordinate as the lookup key.)
273+
267274
**Semantics**
268275

269276
SchemaCoordinate: Name
@@ -307,7 +314,8 @@ SchemaCoordinate: @ Name ( Name : )
307314

308315
**Examples**
309316

310-
This section shows example coordinates for the possible schema element types this syntax covers.
317+
This section shows example coordinates for the possible schema element types
318+
this syntax covers.
311319

312320
All examples below will assume the following schema:
313321

@@ -367,16 +375,14 @@ type Mutation {
367375
}
368376
```
369377

370-
The following table demonstrates how to select various kinds of schema members:
378+
The following table shows examples of Schema Coordinates for elements in the
379+
schema above:
371380

372381
| Schema Coordinate | Description |
373382
| ------------------------------ | ------------------------------------------------------------------- |
374383
| `Business` | `Business` type |
375-
| `User` | `User` type |
376-
| `Business.name` | `name` field on the `Business` type |
377384
| `User.name` | `name` field on the `User` type |
378385
| `Query.searchBusiness(name:)` | `name` argument on the `searchBusiness` field on the `Query` type |
379-
| `Query.searchBusiness(filter:)`| `filter` argument on the `searchBusiness` field on the `Query` type |
380386
| `SearchFilter` | `SearchFilter` enum |
381387
| `SearchFilter.OPEN_NOW` | `OPEN_NOW` value of the`SearchFilter` enum |
382388
| `@private` | `@private` directive definition |
@@ -389,15 +395,19 @@ The following table demonstrates how to select various kinds of schema members:
389395
| `DateTime` | Custom `DateTime` scalar type |
390396
| `String` | Built-in `String` scalar type |
391397

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

394-
The following counter example is *not* considered a valid Schema Coordinate:
401+
For example, the following is *not* a valid Schema Coordinate:
395402

396403
```graphql counter-example
397404
Entity.Business
398405
```
399406

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

402412
## Types
403413

0 commit comments

Comments
 (0)