Skip to content

Commit

Permalink
Editorial: Clarify meta-fields in introspection (#844)
Browse files Browse the repository at this point in the history
* 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.

* Update spec/Section 4 -- Introspection.md

Co-authored-by: Benjie Gillam <[email protected]>

* Update spec/Section 4 -- Introspection.md

Co-authored-by: Benjie Gillam <[email protected]>

* Update spec/Section 4 -- Introspection.md

Co-authored-by: Benjie Gillam <[email protected]>

* wrap

Co-authored-by: Benjie Gillam <[email protected]>
  • Loading branch information
leebyron and benjie authored Apr 9, 2021
1 parent f8b75d3 commit f474e66
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions spec/Section 4 -- Introspection.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 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 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.
As a meta-field, `__typename` is implicit and does not appear in the fields list
in any defined type.


## Schema Introspection
Expand All @@ -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.
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:

Expand Down

0 comments on commit f474e66

Please sign in to comment.