This is just an idea, it's not published yet.
Examples:
- src/graphql.example.ts - an example GraphQL query parser that relies as much as possible on inference for the types.
- src/graphql-explicit-types.example.ts - an example GraphQL query parser that specifies all the AST node types up front.
You can see the output of running TypeScript in example-output.