How pg_graphql works

- Introduction to pg_graphql
- Explains what pg_graphql is and its purpose in serving GraphQL requests.
- Life of a GraphQL Request
- Describes the process of handling a GraphQL request in pg_graphql.
- Begins with the tokenization phase, where the request is broken down into lexical tokens.
- Explains how the tokenizer identifies the start and end of each token based on the grammar rules.
- Highlights the use of lookahead to determine the next token to be parsed.
- Parser
- Introduces the role of the parser in interpreting the tokens and constructing the Abstract Syntax Tree (AST) for the request.
- Shows how the parser uses the grammar rules to determine the structure and relationships within the AST.
- Emphasizes the use of lookahead to guide the parsing process.
- Abstract Syntax Tree (AST)
- Defines what an AST is in pg_graphql and how it is represented using Rust structs and enums.
- Provides examples of AST nodes, such as types and fields, implemented as structs.
- Discusses the importance of a valid AST for query execution.
- Validation
- Elaborates on the need for validation after parsing the request into an AST.
- Explains that a valid AST does not guarantee the query's executability.
- Presents an example to illustrate potential issues and the importance of validation.
Conclusion
- Summarizes the key points discussed in the document regarding the inner workings of pg_graphql in handling GraphQL requests.