Skip to content
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

RFC: support returning applied directives as part of the introspection #1075

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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: [__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
JoviDeCroock marked this conversation as resolved.
Show resolved Hide resolved