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

add __directive meta field parallel to __type #1114

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from 2 commits
Commits
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
39 changes: 36 additions & 3 deletions spec/Section 4 -- Introspection.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,38 @@ would produce the result:
}
```

Similarly, a request containing the operation:

```graphql example
{
__directive(name: "skip") {
name
arguments {
name
type {
name
}
}
}
}
```

would produce the result:

```json example
{
"__directive": {
"name": "skip",
"arguments": [
{
"name": "if",
"type": { "name": "Boolean" }
}
]
}
}
```

**Reserved Names**

Types and fields required by the GraphQL introspection system that are used in
Expand Down Expand Up @@ -85,13 +117,14 @@ operation.

## Schema Introspection

The schema introspection system is accessible from the meta-fields `__schema`
and `__type` which are accessible from the type of the root of a query
operation.
The schema introspection system is accessible from the meta-fields `__schema`,
`__type`, and `_directive` which are accessible from the type of the root of a
yaacovCR marked this conversation as resolved.
Show resolved Hide resolved
query operation.

```graphql
__schema: __Schema!
__type(name: String!): __Type
__directive(name: String!): __Directive
```

Like all meta-fields, these are implicit and do not appear in the fields list in
Expand Down
Loading