Phases of Execution
When GraphQL receives a query string, it goes through these steps:
-
Tokenize:
GraphQL::Language::Lexersplits the string into a stream of tokens -
Parse:
GraphQL::Language::Parserbuilds an abstract syntax tree (AST) out of the stream of tokens -
Validate:
GraphQL::StaticValidation::Validatorvalidates the incoming AST as a valid query for the schema -
Analyze: If there are any query analyzers, they are run with
GraphQL::Analysis.analyze_query -
Execute: The query is traversed,
resolvefunctions are called and the response is built -
Respond: The response is returned as a
GraphQL::Query::Result