File: phases_of_execution.md

package info (click to toggle)
ruby-graphql 1.13.15-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 8,904 kB
  • sloc: ruby: 69,655; yacc: 444; javascript: 330; makefile: 6
file content (18 lines) | stat: -rw-r--r-- 813 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
---
layout: guide
doc_stub: false
search: true
section: Queries
title: Phases of Execution
desc: The steps GraphQL takes to run your query
index: 2
---

When GraphQL receives a query string, it goes through these steps:

- Tokenize: {{ "GraphQL::Language::Lexer" | api_doc }} splits the string into a stream of tokens
- Parse: {{ "GraphQL::Language::Parser" | api_doc }} builds an abstract syntax tree (AST) out of the stream of tokens
- Validate: {{ "GraphQL::StaticValidation::Validator" | api_doc }} validates 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" | api_doc }}
- Execute: The query is traversed, `resolve` functions are called and the response is built
- Respond: The response is returned as a Hash