nitrogql logonitrogql

Frequently Asked Questions

Why did you create nitrogql?

I needed a GraphQL + TypeScript tool for schema-based approach with source maps support.

Does nitrogql work with any UI library or framework?

Yes. Thanks to TypedDocumentNode, generated types are independent of UI libraries or frameworks. For the same reason, you can use nitrogql with any GraphQL client.

Is nitrogql fast?

Yes. nitrogql is written in Rust and is compiled to WebAssembly, running on Node.js' WASM runtime. Often Node.js startup time is longer than the time it takes to generate types.

Does nitrogql support GraphQL code embedded in TypeScript?

No. I like to keep my GraphQL code separate from TypeScript code. I think this is the most straightforward approach to generating types from GraphQL code.

Also, from a tool author perspective, supporting embedded GraphQL code complicates the parser.

I don't like generated files scattered among my source files.

If you use VS Code, you can use the file nesting feature to collapse generated files. Here is an example setting:

{
  "explorer.fileNesting.enabled": true,
  "explorer.fileNesting.patterns": {
    "*.graphql": "${capture}.d.graphql.ts,${capture}.d.graphql.ts.map"
  }
}
Screenshot of VSCode file nesting feature
Generated files can be collapsed under the original GraphQL file.

As another option, nitrogql could implement a mode that generates all types in a dedicated directory. Please let us know if you would like to see this feature.

Contribution?

Welcome!

Why is the nitrogql logo so crooked?

It' drawn by an AI.