GraphQL

Write an awesome doc for GraphQL. A very nice an practical one extracted from GraphQL official documentation.

View on GitHub

Introspection system

[!TIP]

GraphQL APIs designed exclusively for in-house applications, we typically won’t add introspection service in production env. In fact disabling introspection service can be considered part of a security strategy.

To disable it you can use 3rd-party libs such as graphql-disable-introspection.

__typename

__schema

Operation Response
  1. Types defined by us: Robot, SearchResult, Mutation, EventSource, etc.
  2. Built-in scalars
  3. Types preceded/prefixed with a double underscore which are part of the introspection system itself:
    • __Schema.
    • __Type.
    • __TypeKin.
    • __Field.
    • __InputValue.
    • __EnumValue.
    • __Directive.
    • __DirectiveLocation.
The response in JSON format look like this. The entrypoint of available queries which is usually called Query.
The response in JSON format look like this. Essentially it is an array of fields with filed name inside it.