From 8270ca300a5fd54519146bd87baadf3d161ef006 Mon Sep 17 00:00:00 2001 From: Benedikt Franke Date: Mon, 13 Jan 2020 11:54:46 +0100 Subject: [PATCH 1/4] Servers must preserve lexical ordering between SDL and introspection https://github.com/graphql/graphql-spec/issues/577#issuecomment-519226398 --- spec/Section 4 -- Introspection.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/spec/Section 4 -- Introspection.md b/spec/Section 4 -- Introspection.md index d2f85c55c..8848f1a56 100644 --- a/spec/Section 4 -- Introspection.md +++ b/spec/Section 4 -- Introspection.md @@ -56,6 +56,7 @@ would return } ``` + ## Reserved Names Types and fields required by the GraphQL introspection system that are used in @@ -99,6 +100,22 @@ identify which actual type of the possible types has been returned. This field is implicit and does not appear in the fields list in any defined type. +## Ordering + +Servers must preserve lexical ordering between SDL and introspection. + +For the given SDL: + +```graphql +type MyType { + field1(arg1: String, arg2: Int): Boolean + field2: Boolean +} +``` + +The introspection result must produce an ordered array of fields `[field1, field2]` for `MyType` +and an ordered array of arguments `[arg1, arg2]` for `MyType.field1. + ## Schema Introspection The schema introspection system is accessible from the meta-fields `__schema` From a1dc67156b3e152a1e36c1c7ce7434ea8ce1c402 Mon Sep 17 00:00:00 2001 From: Benedikt Franke Date: Mon, 13 Jan 2020 11:57:02 +0100 Subject: [PATCH 2/4] Whitespace --- spec/Section 4 -- Introspection.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/spec/Section 4 -- Introspection.md b/spec/Section 4 -- Introspection.md index 8848f1a56..0dcf0c264 100644 --- a/spec/Section 4 -- Introspection.md +++ b/spec/Section 4 -- Introspection.md @@ -116,6 +116,7 @@ type MyType { The introspection result must produce an ordered array of fields `[field1, field2]` for `MyType` and an ordered array of arguments `[arg1, arg2]` for `MyType.field1. + ## Schema Introspection The schema introspection system is accessible from the meta-fields `__schema` @@ -412,6 +413,7 @@ Fields default value used by this input value in the condition a value is not provided at runtime. If this input value has no default value, returns {null}. + ### The __EnumValue Type The `__EnumValue` type represents one of possible values of an enum. @@ -424,6 +426,7 @@ Fields otherwise {false}. * `deprecationReason` optionally provides a reason why this enum value is deprecated. + ### The __Directive Type The `__Directive` type represents a Directive that a server supports. From 1fcfdbfd1b9eb9d366bfab3d80260e78a3da0c33 Mon Sep 17 00:00:00 2001 From: spawnia Date: Sat, 2 May 2020 20:48:48 +0200 Subject: [PATCH 3/4] Add missing backtick --- 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 f0d57472b..9ea14197f 100644 --- a/spec/Section 4 -- Introspection.md +++ b/spec/Section 4 -- Introspection.md @@ -114,7 +114,7 @@ type MyType { ``` The introspection result must produce an ordered array of fields `[field1, field2]` for `MyType` -and an ordered array of arguments `[arg1, arg2]` for `MyType.field1. +and an ordered array of arguments `[arg1, arg2]` for `MyType.field1`. ## Schema Introspection From 6e3d2d3fbc2d99fb505e7e268ca779763452ceb4 Mon Sep 17 00:00:00 2001 From: spawnia Date: Thu, 16 Jun 2022 18:45:34 +0200 Subject: [PATCH 4/4] fix merge conflict resolution --- spec/Section 4 -- Introspection.md | 45 ++++++++++++++++++++++-------- 1 file changed, 34 insertions(+), 11 deletions(-) diff --git a/spec/Section 4 -- Introspection.md b/spec/Section 4 -- Introspection.md index 663a63ec4..20d0f3069 100644 --- a/spec/Section 4 -- Introspection.md +++ b/spec/Section 4 -- Introspection.md @@ -56,8 +56,7 @@ would produce the result: } ``` - -## Reserved Names +**Reserved Names** Types and fields required by the GraphQL introspection system that are used in the same context as user-defined types and fields are prefixed with {"\_\_"} two @@ -462,8 +461,7 @@ Fields\: - `deprecationReason` optionally provides a reason why this input field or argument is deprecated. - -### The __EnumValue Type +### The \_\_EnumValue Type The `__EnumValue` type represents one of possible values of an enum. @@ -473,18 +471,43 @@ Fields\: - `description` may return a String or {null} - `isDeprecated` returns {true} if this enum value should no longer be used, otherwise {false}. -* `deprecationReason` optionally provides a reason why this enum value is deprecated. +- `deprecationReason` optionally provides a reason why this enum value is + deprecated. +### The \_\_Directive Type -### The __Directive Type +The `__Directive` type represents a directive that a service supports. -The `__Directive` type represents a Directive that a server supports. +This includes both any _built-in directive_ and any _custom directive_. -Fields +Individual directives may only be used in locations that are explicitly +supported. All possible locations are listed in the `__DirectiveLocation` enum: -* `name` must return a String -* `description` may return a String or {null} -* `locations` returns a List of `__DirectiveLocation` representing the valid +- {"QUERY"} +- {"MUTATION"} +- {"SUBSCRIPTION"} +- {"FIELD"} +- {"FRAGMENT_DEFINITION"} +- {"FRAGMENT_SPREAD"} +- {"INLINE_FRAGMENT"} +- {"VARIABLE_DEFINITION"} +- {"SCHEMA"} +- {"SCALAR"} +- {"OBJECT"} +- {"FIELD_DEFINITION"} +- {"ARGUMENT_DEFINITION"} +- {"INTERFACE"} +- {"UNION"} +- {"ENUM"} +- {"ENUM_VALUE"} +- {"INPUT_OBJECT"} +- {"INPUT_FIELD_DEFINITION"} + +Fields\: + +- `name` must return a String +- `description` may return a String or {null} +- `locations` returns a List of `__DirectiveLocation` representing the valid locations this directive may be placed. - `args` returns a List of `__InputValue` representing the arguments this directive accepts.