Introduction

Document

  • string that contains definitions
Document:
   ExecutableDefinition+
   TypeSystemDefinition TypeSystemExtension*

ExecutableDefinition:
    OperationDefinition
    FragmentDefinition
  • beware: differs from spec, spec allows for partial documents and mixes of query language and IDL, here assume document contains either executable operations or single schema, see #788 ⚠️

Grammar

  • white space, line terminators, commas are not significant, only stylistic, e.g. argument list, array, etc.
  • comments are lines starting with #
  • beware: comments are different than in JS, not // ❗️
  • names can consist of [a-zA-Z0-9_] but not start with a digit
  • names are case sensitive
  • lists are unordered, e.g. argument list, selection list, etc.

Request / Response

  • server runs GraphQL engine that can execute operations
  • client builds string of document containing executable operation(s), sends request to server along with variables and name of operations to run (if document contains more than one operation)
  • server verifies operation against schema, runs resolver functions, returns response with data as JSON ??? - by convention data is under data key in JSON object, error key for errors, … ?

Errors

Resources