From 608ed6c3563ea396e9286e613ecf095710b60b4c Mon Sep 17 00:00:00 2001 From: Lee Byron Date: Wed, 7 Apr 2021 21:20:06 -0700 Subject: [PATCH 1/5] Editorial: Clarify meta-fields in introspection Derived from #777 Renames "field" to "meta-field" consistently. Adds "with the single exception of the subscription root operation type". Clarifies some language. --- spec/Section 4 -- Introspection.md | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/spec/Section 4 -- Introspection.md b/spec/Section 4 -- Introspection.md index 3e9777148..b42c09154 100644 --- a/spec/Section 4 -- Introspection.md +++ b/spec/Section 4 -- Introspection.md @@ -89,14 +89,17 @@ warnings. ## Type Name Introspection -GraphQL supports type name introspection at any point within a query by the -meta-field `__typename: String!` when querying against any Object, Interface, -or Union. It returns the name of the object type currently being queried. +GraphQL supports type name introspection at any selection set within an +operation with the meta-field `__typename: String!` on any Object, +Interface, or Union; with the single exception of the subscription root +operation type. It returns the name of the concrete Object type at that point +during execution. This is most often used when querying against Interface or Union types to -identify which actual type of the possible types has been returned. +identify which actual Object type of the possible types has been returned. -This field is implicit and does not appear in the fields list in any defined type. +This meta-field is implicit and does not appear in the fields list in any +defined type. ## Schema Introspection @@ -110,8 +113,8 @@ __schema: __Schema! __type(name: String!): __Type ``` -These fields are implicit and do not appear in the fields list in the root type -of the query operation. +These meta-fields are implicit and do not appear in the fields list in the root +type of the query operation. The schema of the GraphQL schema introspection system: From 058e939069ed700b08bb67b318ab20456cd1be29 Mon Sep 17 00:00:00 2001 From: Lee Byron Date: Thu, 8 Apr 2021 21:57:56 -0700 Subject: [PATCH 2/5] Update spec/Section 4 -- Introspection.md Co-authored-by: Benjie Gillam --- 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 b42c09154..5110a6f06 100644 --- a/spec/Section 4 -- Introspection.md +++ b/spec/Section 4 -- Introspection.md @@ -98,7 +98,7 @@ during execution. This is most often used when querying against Interface or Union types to identify which actual Object type of the possible types has been returned. -This meta-field is implicit and does not appear in the fields list in any +As a meta-field, `__typename` is implicit and does not appear in the fields list in any defined type. From e23db7c29f4234759bb17830da38ce10b5c4e3ab Mon Sep 17 00:00:00 2001 From: Lee Byron Date: Thu, 8 Apr 2021 21:58:01 -0700 Subject: [PATCH 3/5] Update spec/Section 4 -- Introspection.md Co-authored-by: Benjie Gillam --- 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 5110a6f06..c85e0fc9c 100644 --- a/spec/Section 4 -- Introspection.md +++ b/spec/Section 4 -- Introspection.md @@ -113,7 +113,7 @@ __schema: __Schema! __type(name: String!): __Type ``` -These meta-fields are implicit and do not appear in the fields list in the root +Like all meta-fields, these are implicit and do not appear in the fields list in the root type of the query operation. The schema of the GraphQL schema introspection system: From c8ca8a9b678801022259779d53de0b5e394b44ad Mon Sep 17 00:00:00 2001 From: Lee Byron Date: Thu, 8 Apr 2021 21:58:40 -0700 Subject: [PATCH 4/5] Update spec/Section 4 -- Introspection.md Co-authored-by: Benjie Gillam --- spec/Section 4 -- Introspection.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/spec/Section 4 -- Introspection.md b/spec/Section 4 -- Introspection.md index c85e0fc9c..7b8aae75a 100644 --- a/spec/Section 4 -- Introspection.md +++ b/spec/Section 4 -- Introspection.md @@ -89,11 +89,11 @@ warnings. ## Type Name Introspection -GraphQL supports type name introspection at any selection set within an -operation with the meta-field `__typename: String!` on any Object, -Interface, or Union; with the single exception of the subscription root -operation type. It returns the name of the concrete Object type at that point -during execution. +GraphQL supports type name introspection within any selection set in an +operation, with the single exception of selections at the root of a subscription +operation. Type name introspection is accomplished via the meta-field +`__typename: String!` on any Object, Interface, or Union. It returns the name of +the concrete Object type at that point during execution. This is most often used when querying against Interface or Union types to identify which actual Object type of the possible types has been returned. From 3732a97125187f1cbba4dfa49e2eb6063ec1c39e Mon Sep 17 00:00:00 2001 From: Lee Byron Date: Thu, 8 Apr 2021 22:00:09 -0700 Subject: [PATCH 5/5] wrap --- spec/Section 4 -- Introspection.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/spec/Section 4 -- Introspection.md b/spec/Section 4 -- Introspection.md index 7b8aae75a..a231442e4 100644 --- a/spec/Section 4 -- Introspection.md +++ b/spec/Section 4 -- Introspection.md @@ -98,8 +98,8 @@ the concrete Object type at that point during execution. This is most often used when querying against Interface or Union types to identify which actual Object type of the possible types has been returned. -As a meta-field, `__typename` is implicit and does not appear in the fields list in any -defined type. +As a meta-field, `__typename` is implicit and does not appear in the fields list +in any defined type. ## Schema Introspection @@ -113,8 +113,8 @@ __schema: __Schema! __type(name: String!): __Type ``` -Like all meta-fields, these are implicit and do not appear in the fields list in the root -type of the query operation. +Like all meta-fields, these are implicit and do not appear in the fields list in +the root type of the query operation. The schema of the GraphQL schema introspection system: