Skip to content

Commit

Permalink
amend spec text to support introspection directives
Browse files Browse the repository at this point in the history
  • Loading branch information
JoviDeCroock committed Feb 7, 2024
1 parent feac5a5 commit c01e0a7
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions spec/Section 4 -- Introspection.md
Expand Up @@ -151,6 +151,7 @@ type __Type {
ofType: __Type
# may be non-null for custom SCALAR, otherwise null.
specifiedByURL: String
directives: [__AppliedDirective!]
}

enum __TypeKind {
Expand All @@ -171,6 +172,7 @@ type __Field {
type: __Type!
isDeprecated: Boolean!
deprecationReason: String
directives: [__AppliedDirective!]
}

type __InputValue {
Expand All @@ -180,13 +182,15 @@ type __InputValue {
defaultValue: String
isDeprecated: Boolean!
deprecationReason: String
directives: [__AppliedDirective!]
}

type __EnumValue {
name: String!
description: String
isDeprecated: Boolean!
deprecationReason: String
directives: [__AppliedDirective!]
}

type __Directive {
Expand All @@ -197,6 +201,16 @@ type __Directive {
isRepeatable: Boolean!
}

type __AppliedDirective {
name: String!
args(includeDeprecated: Boolean = false): [__DirectiveArgument!]!
}

type __DirectiveArgument {
name: String!
value: String!
}

enum __DirectiveLocation {
QUERY
MUTATION
Expand Down Expand Up @@ -280,6 +294,7 @@ Fields\:
- `specifiedByURL` may return a String (in the form of a URL) for custom
scalars, otherwise must be {null}.
- All other fields must return {null}.
- `directives` must return the ordered set of directives applied to this scalar.

**Object**

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

**Union**

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

**Interface**

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

**Enum**

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

**Input Object**

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

**List**

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

### The \_\_InputValue Type

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

### The \_\_EnumValue Type

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

### The \_\_Directive Type

Expand Down Expand Up @@ -499,3 +522,25 @@ Fields\:
{true}, deprecated arguments are also returned.
- `isRepeatable` must return a Boolean that indicates if the directive may be
used repeatedly at a single location.

### The \_\_AppliedDirective Type

The `__AppliedDirective` type represents a directive applied to a schema element.

This includes both any _built-in directive_ and any _custom directive_.

Fields\:

- `name` must return a String
- `args` returns a List of `__DirectiveArgument` representing the arguments this
directive accepts.

### The \_\_DirectiveArgument Type

The `__DirectiveArgument` type represents an argument specified in a directive applied
to an element in the schema..

Fields\:

- `name` must return a String
- `value` must return the value for the argument as a string

0 comments on commit c01e0a7

Please sign in to comment.