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 all 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
35 changes: 32 additions & 3 deletions spec/Section 4 -- Introspection.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,34 @@ would produce the result:
}
```

Similarly, a request containing the operation:

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

would produce the result:

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

**Reserved Names**

Types and fields required by the GraphQL introspection system that are used in
Expand Down Expand Up @@ -85,13 +113,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
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