Skip to content

Commit 8c01802

Browse files
committed
split out SchemaCoordinate definition
1 parent dc1374d commit 8c01802

File tree

1 file changed

+37
-21
lines changed

1 file changed

+37
-21
lines changed

spec/Section 3 -- Type System.md

Lines changed: 37 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2173,11 +2173,21 @@ scalar UUID @specifiedBy(url: "https://tools.ietf.org/html/rfc4122")
21732173

21742174
SchemaCoordinate :
21752175

2176-
- Name
2177-
- Name . Name
2178-
- Name . Name ( Name : )
2179-
- @ Name
2180-
- @ Name ( Name : )
2176+
- TypeCoordinate
2177+
- MemberCoordinate
2178+
- ArgumentCoordinate
2179+
- DirectiveCoordinate
2180+
- DirectiveArgumentCoordinate
2181+
2182+
TypeCoordinate : Name
2183+
2184+
MemberCoordinate : Name . Name
2185+
2186+
ArgumentCoordinate : Name . Name ( Name : )
2187+
2188+
DirectiveCoordinate : @ Name
2189+
2190+
DirectiveArgumentCoordinate : @ Name ( Name : )
21812191

21822192
:: A _schema coordinate_ is a human readable string that uniquely identifies a
21832193
_schema element_ within a GraphQL Schema.
@@ -2194,9 +2204,9 @@ coordinates which refer to built-in schema elements. However it must not refer
21942204
to a meta-field. For example, `Business.__typename` is _not_ a valid schema
21952205
coordinate.
21962206

2197-
Note: Union members are not valid _schema coordinates_ as they reference
2198-
existing types in the schema. This preserves the uniqueness property of a
2199-
_schema coordinate_ as stated above.
2207+
Note: Union members are not valid _schema coordinate_ as they reference existing
2208+
types in the schema. This preserves the uniqueness property of a _schema
2209+
coordinate_ as stated above.
22002210

22012211
Note: A {SchemaCoordinate} is not a definition within a GraphQL {Document}, but
22022212
a separate standalone grammar, intended to be used by tools to reference types,
@@ -2214,28 +2224,32 @@ If the _schema element_ cannot be found, the resolve function will not yield a
22142224
value (without raising an error). However, an error will be raised if any
22152225
non-leaf nodes within a _schema coordinate_ cannot be found in the {schema}.
22162226

2217-
SchemaCoordinate : Name
2227+
TypeCoordinate : Name
22182228

22192229
1. Let {typeName} be the value of {Name}.
2220-
2. Return the type in the {schema} named {typeName}, or {null} if no such type exists.
2230+
2. Return the type in the {schema} named {typeName}, or {null} if no such type
2231+
exists.
22212232

2222-
SchemaCoordinate : Name . Name
2233+
MemberCoordinate : Name . Name
22232234

22242235
1. Let {typeName} be the value of the first {Name}.
22252236
2. Let {type} be the type in the {schema} named {typeName}.
22262237
3. Assert: {type} must exist.
22272238
4. If {type} is an Enum type:
22282239
1. Let {enumValueName} be the value of the second {Name}.
2229-
2. Return the enum value of {type} named {enumValueName}, or {null} if no such value exists.
2240+
2. Return the enum value of {type} named {enumValueName}, or {null} if no
2241+
such value exists.
22302242
5. Otherwise, if {type} is an Input Object type:
22312243
1. Let {inputFieldName} be the value of the second {Name}.
2232-
2. Return the input field of {type} named {inputFieldName}, or {null} if no such input field exists.
2244+
2. Return the input field of {type} named {inputFieldName}, or {null} if no
2245+
such input field exists.
22332246
6. Otherwise:
22342247
1. Assert: {type} must be an Object or Interface type.
22352248
2. Let {fieldName} be the value of the second {Name}.
2236-
3. Return the field of {type} named {fieldName}, or {null} if no such field exists.
2249+
3. Return the field of {type} named {fieldName}, or {null} if no such field
2250+
exists.
22372251

2238-
SchemaCoordinate : Name . Name ( Name : )
2252+
ArgumentCoordinate : Name . Name ( Name : )
22392253

22402254
1. Let {typeName} be the value of the first {Name}.
22412255
2. Let {type} be the type in the {schema} named {typeName}.
@@ -2245,21 +2259,23 @@ SchemaCoordinate : Name . Name ( Name : )
22452259
6. Let {field} be the field of {type} named {fieldName}.
22462260
7. Assert: {field} must exist.
22472261
8. Let {fieldArgumentName} be the value of the third {Name}.
2248-
9. Return the argument of {field} named {fieldArgumentName}, or {null} if no such argument exists.
2262+
9. Return the argument of {field} named {fieldArgumentName}, or {null} if no
2263+
such argument exists.
22492264

2250-
SchemaCoordinate : @ Name
2265+
DirectiveCoordinate : @ Name
22512266

22522267
1. Let {directiveName} be the value of the first {Name}.
2253-
2. Return the directive in the {schema} named {directiveName}, or {null} if no such directive exists.
2268+
2. Return the directive in the {schema} named {directiveName}, or {null} if no
2269+
such directive exists.
22542270

2255-
SchemaCoordinate : @ Name ( Name : )
2271+
DirectiveArgumentCoordinate : @ Name ( Name : )
22562272

22572273
1. Let {directiveName} be the value of the first {Name}.
22582274
2. Let {directive} be the directive in the {schema} named {directiveName}.
22592275
3. Assert: {directive} must exist.
22602276
4. Let {directiveArgumentName} be the value of the second {Name}.
2261-
5. Return the argument of {directive} named
2262-
{directiveArgumentName}, or {null} if no such argument exists.
2277+
5. Return the argument of {directive} named {directiveArgumentName}, or {null}
2278+
if no such argument exists.
22632279

22642280
**Examples**
22652281

0 commit comments

Comments
 (0)