Skip to content

Commit cb9ee1d

Browse files
committed
amend spec text to support introspection directives
1 parent feac5a5 commit cb9ee1d

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

spec/Section 4 -- Introspection.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ type __Type {
151151
ofType: __Type
152152
# may be non-null for custom SCALAR, otherwise null.
153153
specifiedByURL: String
154+
directives: [__AppliedDirective!]
154155
}
155156

156157
enum __TypeKind {
@@ -171,6 +172,7 @@ type __Field {
171172
type: __Type!
172173
isDeprecated: Boolean!
173174
deprecationReason: String
175+
directives: [__AppliedDirective!]
174176
}
175177

176178
type __InputValue {
@@ -180,13 +182,15 @@ type __InputValue {
180182
defaultValue: String
181183
isDeprecated: Boolean!
182184
deprecationReason: String
185+
directives: [__AppliedDirective!]
183186
}
184187

185188
type __EnumValue {
186189
name: String!
187190
description: String
188191
isDeprecated: Boolean!
189192
deprecationReason: String
193+
directives: [__AppliedDirective!]
190194
}
191195

192196
type __Directive {
@@ -197,6 +201,16 @@ type __Directive {
197201
isRepeatable: Boolean!
198202
}
199203

204+
type __AppliedDirective {
205+
name: String!
206+
args: [__DirectiveArgument!]!
207+
}
208+
209+
type __DirectiveArgument {
210+
name: String!
211+
value: String!
212+
}
213+
200214
enum __DirectiveLocation {
201215
QUERY
202216
MUTATION
@@ -280,6 +294,7 @@ Fields\:
280294
- `specifiedByURL` may return a String (in the form of a URL) for custom
281295
scalars, otherwise must be {null}.
282296
- All other fields must return {null}.
297+
- `directives` must return the ordered set of directives applied to this scalar.
283298

284299
**Object**
285300

@@ -297,6 +312,7 @@ Fields\:
297312
- `interfaces` must return the set of interfaces that an object implements (if
298313
none, `interfaces` must return the empty set).
299314
- All other fields must return {null}.
315+
- `directives` must return the ordered set of directives applied to this type.
300316

301317
**Union**
302318

@@ -312,6 +328,7 @@ Fields\:
312328
- `possibleTypes` returns the list of types that can be represented within this
313329
union. They must be object types.
314330
- All other fields must return {null}.
331+
- `directives` must return the ordered set of directives applied to this union.
315332

316333
**Interface**
317334

@@ -334,6 +351,7 @@ Fields\:
334351
- `possibleTypes` returns the list of types that implement this interface. They
335352
must be object types.
336353
- All other fields must return {null}.
354+
- `directives` must return the ordered set of directives applied to this interface.
337355

338356
**Enum**
339357

@@ -349,6 +367,7 @@ Fields\:
349367
- Accepts the argument `includeDeprecated` which defaults to {false}. If
350368
{true}, deprecated enum values are also returned.
351369
- All other fields must return {null}.
370+
- `directives` must return the ordered set of directives applied to this enum.
352371

353372
**Input Object**
354373

@@ -374,6 +393,7 @@ Fields\:
374393
- Accepts the argument `includeDeprecated` which defaults to {false}. If
375394
{true}, deprecated input fields are also returned.
376395
- All other fields must return {null}.
396+
- `directives` must return the ordered set of directives applied to this input-object.
377397

378398
**List**
379399

@@ -425,6 +445,7 @@ Fields\:
425445
- `isDeprecated` returns {true} if this field should no longer be used,
426446
otherwise {false}.
427447
- `deprecationReason` optionally provides a reason why this field is deprecated.
448+
- `directives` must return the ordered set of directives applied to this field.
428449

429450
### The \_\_InputValue Type
430451

@@ -444,6 +465,7 @@ Fields\:
444465
be used, otherwise {false}.
445466
- `deprecationReason` optionally provides a reason why this input field or
446467
argument is deprecated.
468+
- `directives` must return the ordered set of directives applied to this input value.
447469

448470
### The \_\_EnumValue Type
449471

@@ -457,6 +479,7 @@ Fields\:
457479
otherwise {false}.
458480
- `deprecationReason` optionally provides a reason why this enum value is
459481
deprecated.
482+
- `directives` must return the ordered set of directives applied to this enum-value.
460483

461484
### The \_\_Directive Type
462485

@@ -499,3 +522,25 @@ Fields\:
499522
{true}, deprecated arguments are also returned.
500523
- `isRepeatable` must return a Boolean that indicates if the directive may be
501524
used repeatedly at a single location.
525+
526+
### The \_\_AppliedDirective Type
527+
528+
The `__AppliedDirective` type represents a directive applied to a schema element.
529+
530+
This includes both any _built-in directive_ and any _custom directive_.
531+
532+
Fields\:
533+
534+
- `name` must return a String
535+
- `args` returns a List of `__DirectiveArgument` representing the arguments this
536+
directive accepts.
537+
538+
### The \_\_DirectiveArgument Type
539+
540+
The `__DirectiveArgument` type represents an argument specified in a directive applied
541+
to an element in the schema..
542+
543+
Fields\:
544+
545+
- `name` must return a String
546+
- `value` must return the value for the argument as a string

0 commit comments

Comments
 (0)