From 36920bb79c6937e2bf93b6fd7db9b1b9c084a983 Mon Sep 17 00:00:00 2001 From: Yaacov Rydzinski Date: Wed, 25 Sep 2024 06:13:41 +0300 Subject: [PATCH 1/4] add __directive meta field --- spec/Section 4 -- Introspection.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/spec/Section 4 -- Introspection.md b/spec/Section 4 -- Introspection.md index d2ec33b6b..7baa238bc 100644 --- a/spec/Section 4 -- Introspection.md +++ b/spec/Section 4 -- Introspection.md @@ -85,13 +85,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 From 6b4efd36594507c44828923fcc82170a8b006399 Mon Sep 17 00:00:00 2001 From: Yaacov Rydzinski Date: Wed, 25 Sep 2024 06:18:03 +0300 Subject: [PATCH 2/4] add example --- spec/Section 4 -- Introspection.md | 32 ++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/spec/Section 4 -- Introspection.md b/spec/Section 4 -- Introspection.md index 7baa238bc..6e7627d4b 100644 --- a/spec/Section 4 -- Introspection.md +++ b/spec/Section 4 -- Introspection.md @@ -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 From ef4ef3ce64d0fb26d637ddeade1ed0ff06bf542c Mon Sep 17 00:00:00 2001 From: Yaacov Rydzinski Date: Wed, 25 Sep 2024 14:53:47 +0300 Subject: [PATCH 3/4] Gotta double underscore Thanks @benjie Co-authored-by: Benjie --- spec/Section 4 -- Introspection.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/Section 4 -- Introspection.md b/spec/Section 4 -- Introspection.md index 6e7627d4b..308999b41 100644 --- a/spec/Section 4 -- Introspection.md +++ b/spec/Section 4 -- Introspection.md @@ -118,7 +118,7 @@ operation. ## Schema Introspection 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 +`__type`, and `__directive` which are accessible from the type of the root of a query operation. ```graphql From 2196942b3015f819d858ecff77ababda2fd7748a Mon Sep 17 00:00:00 2001 From: Yaacov Rydzinski Date: Wed, 25 Sep 2024 15:27:12 +0300 Subject: [PATCH 4/4] skip type for input arg for skip as we haven't yet introduced the schema so nullable types might be confusing --- spec/Section 4 -- Introspection.md | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/spec/Section 4 -- Introspection.md b/spec/Section 4 -- Introspection.md index 308999b41..17133ef74 100644 --- a/spec/Section 4 -- Introspection.md +++ b/spec/Section 4 -- Introspection.md @@ -64,9 +64,6 @@ Similarly, a request containing the operation: name arguments { name - type { - name - } } } } @@ -80,8 +77,7 @@ would produce the result: "name": "skip", "arguments": [ { - "name": "if", - "type": { "name": "Boolean" } + "name": "if" } ] }