GraphQL JIT Compiler to JavaScript. Current stable version 0.8.7, released monthly. Compiles GraphQL queries into optimized JavaScript functions, offering up to 100x faster execution compared to graphql-js. Key differentiator: ahead-of-time compilation with runtime type validation, supports both ESM and CJS. Requires graphql >=15.
npm install graphql-jitNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Compile a simple GraphQL query and execute it. Shows schema building, parsing, validation, compilation, and execution.
Use Node.js 14+ (recommended 18+).
Use import syntax or upgrade to Node 18+ with 'type': 'module' in package.json.
Check if 'query' key exists on the result before calling as function.
Migrate to the new default logic when the option is removed in future releases.
Upgrade to v0.8.6+ which fixes this issue.
Use import { compileQuery } from 'graphql-jit'.Replace `import graphqlJit from 'graphql-jit'` with `import { compileQuery } from 'graphql-jit'`.Ensure the same graphql version is used for schema building and compileQuery.
Install both: `npm install graphql-jit graphql`.