Skip to content

Schema Coordinates #794

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 54 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
38616cc
Add Schema Coordinates RFC
magicmark Sep 17, 2020
45fb46c
Update schema coordinates spec edit
magicmark Nov 18, 2020
eabdaff
implement PR suggestions
magicmark Nov 21, 2020
f994f99
Tweak example table wording
magicmark Nov 22, 2020
17002d4
Apply suggestions from code review
magicmark Nov 23, 2020
6456c5f
enumName -> enumValueName
magicmark Nov 28, 2020
4905977
- Add PR feedback
magicmark Jan 4, 2021
8be29ca
Update Section 3 -- Type System.md
magicmark Jan 7, 2021
568d26f
Editorial on grammar and semantics
leebyron Apr 13, 2021
b8f3f47
Move section
leebyron Apr 13, 2021
8580162
Simplify examples
leebyron Apr 14, 2021
87a38e2
standalone
leebyron Apr 15, 2021
75c48ba
update numbers
leebyron Apr 16, 2021
148d073
clarify element
leebyron Apr 16, 2021
c43f4aa
Update Punctuator grammar
leebyron Apr 16, 2021
bb896cf
specify schema element
leebyron Apr 16, 2021
e5a2092
fix example
leebyron Apr 16, 2021
b65eb31
clarify metafields
leebyron Apr 16, 2021
c16a28b
Better Punctator
leebyron Apr 16, 2021
93bd2c6
Minor algo variable name refinements
leebyron Apr 22, 2021
b2e42e8
whitespace fix
magicmark Dec 10, 2024
4ce2d48
add note about union members
magicmark Dec 10, 2024
2d60b33
prettier
magicmark Dec 10, 2024
d61cdc3
formatting
magicmark Dec 10, 2024
caed065
Update spec/Section 3 -- Type System.md
magicmark Jan 2, 2025
07b3bbd
Update spec/Section 3 -- Type System.md
magicmark Jan 2, 2025
a3383ee
Merge branch 'main' into schema_coordinates_spec_edit
benjie May 15, 2025
258d841
Run prettier
benjie May 16, 2025
8a97138
add spec updates
magicmark Jun 2, 2025
c8a2cfe
Add back assertion
magicmark Jun 2, 2025
a96836a
assert that ... -> assert ...
magicmark Jun 2, 2025
3effd4a
consistent periods
magicmark Jun 2, 2025
9feceb2
consistent exists/must exist
magicmark Jun 2, 2025
11b9e96
void -> null
magicmark Jun 2, 2025
10742dd
remove note prefix for error throwing note
magicmark Jun 2, 2025
4b9f37a
Various stylistic fixes
benjie Jun 2, 2025
3555f57
Update spec/Section 3 -- Type System.md
magicmark Jun 2, 2025
a52e312
Update spec/Section 3 -- Type System.md
magicmark Jun 2, 2025
dc1374d
Apply benjie's suggestions from code review
magicmark Jun 2, 2025
8c01802
split out SchemaCoordinate definition
magicmark Jun 2, 2025
b4f2515
Update spec/Section 3 -- Type System.md
magicmark Jun 2, 2025
8584fa3
condense assertion
magicmark Jun 2, 2025
37c9c10
more condensing
magicmark Jun 2, 2025
87f6bd0
Update spec/Appendix B -- Grammar Summary.md
magicmark Jun 3, 2025
1cbad5d
Use `::` syntax for enum values
benjie Jun 5, 2025
ff1ccb4
Merge pull request #1 from graphql/coloncolon
magicmark Jun 5, 2025
7b75489
Revert "Use `::` syntax for enum values"
magicmark Jun 6, 2025
be6938c
revert back to MemberCoordinates
magicmark Jun 6, 2025
f96841f
Merge branch 'graphql:main' into schema_coordinates_spec_edit
magicmark Jun 25, 2025
5ac68a0
", or {null} if no such field exists." -> "if it exists."
magicmark Jun 25, 2025
62ce19a
add non-metafield clarification
magicmark Jun 25, 2025
c0dee02
Spell check
magicmark Jun 25, 2025
3e4bdf8
Merge branch 'graphql:main' into schema_coordinates_spec_edit
magicmark Jul 3, 2025
802d378
Add note about meta-fields
magicmark Jul 3, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Editorial on grammar and semantics
  • Loading branch information
leebyron authored and magicmark committed Dec 10, 2024
commit 568d26f4ed13c9d01b585a2fb97f6223fe1d89d8
7 changes: 7 additions & 0 deletions spec/Appendix B -- Grammar Summary.md
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,13 @@ SchemaExtension :

RootOperationTypeDefinition : OperationType : NamedType

SchemaCoordinate :
- Name
- Name . Name
- Name . Name ( Name : )
- @ Name
- @ Name ( Name : )

Description : StringValue

TypeDefinition :
Expand Down
48 changes: 24 additions & 24 deletions spec/Section 3 -- Type System.md
Original file line number Diff line number Diff line change
Expand Up @@ -287,61 +287,61 @@ Schema extensions have the potential to be invalid if incorrectly defined.
Schema Coordinates are human readable strings that uniquely identify a specific
type, field, argument, enum value, or directive defined in a GraphQL Schema.

**Definition**

SchemaCoordinate:
SchemaCoordinate :
- Name
- Name . Name
- Name . Name ( Name : )
- @ Name
- @ Name ( Name : )

Note: The `SchemaCoordinate` syntax is not part of a GraphQL Document. Schema
Coordinates are a separate syntax, intended to be used by tooling when
referencing types and fields or other schema elements. (For example, a server
that wishes to keep track of the number of times fields have been accessed may
use their Schema Coordinate as the lookup key.)
Note: A {SchemaCoordinate} is not a definition within a GraphQL {Document}.
Schema coordinates are a separate syntax, intended to be used by tools to
reference types and fields or other schema elements. For example: within
documentation, or as lookup keys a service uses to track usage frequency.

**Semantics**

SchemaCoordinate: Name
A schema coordinate's semantics assume they are interpreted in the context of
a single GraphQL {schema}.

SchemaCoordinate : Name
1. Let {typeName} be the value of the first {Name}.
2. Return the type in the schema named {typeName}.
2. Return the type in the {schema} named {typeName}.

SchemaCoordinate: Name . Name
SchemaCoordinate : Name . Name
1. Let {typeName} be the value of the first {Name}.
2. Let {type} be the type in the schema named {typeName}.
2. Let {type} be the type in the {schema} named {typeName}.
3. If {type} is an Enum type:
1. Let {enumValueName} be the value of the second {Name}.
2. Return the enum value of {type} named {enumValueName}.
4. Otherwise if {type} is an Input Object type:
1. Let {inputFieldName} be the value of the second {Name}.
2. Return the input field of {type} named {inputFieldName}.
5. Otherwise:
1. Assert: {type} must be an Object or Interface type.
1. Assert {type} must be an Object or Interface type.
2. Let {fieldName} be the value of the second {Name}.
3. Return the field of {type} named {fieldName}.
SchemaCoordinate: Name . Name ( Name : )

SchemaCoordinate : Name . Name ( Name : )
1. Let {typeName} be the value of the first {Name}.
2. Let {type} be the type in the schema named {typeName}.
3. Assert: {type} must be an Object or Interface type.
2. Let {type} be the type in the {schema} named {typeName}.
3. Assert {type} must be an Object or Interface type.
4. Let {fieldName} be the value of the second {Name}.
5. Let {field} be the field of {type} named {fieldName}.
6. Assert: {field} must exist.
6. Assert {field} must exist.
7. Let {argumentName} be the value of the third {Name}.
8. Return the argument of {field} named {argumentName}.

SchemaCoordinate: @ Name
SchemaCoordinate : @ Name
1. Let {directiveName} be the value of the first {Name}.
2. Return the directive in the schema named {directiveName}.
2. Return the directive in the {schema} named {directiveName}.

SchemaCoordinate: @ Name ( Name : )
SchemaCoordinate : @ Name ( Name : )
1. Let {directiveName} be the value of the first {Name}.
2. Let {directive} be the directive in the schema named {directiveName}.
3. Assert: {directive} must exist.
2. Let {directive} be the directive in the {schema} named {directiveName}.
3. Assert {directive} must exist.
7. Let {argumentName} be the value of the second {Name}.
8. Return the argument of {directive} named {argumentName}
8. Return the argument of {directive} named {argumentName}.

**Examples**

Expand Down