A lightweight standalone parser for GraphQL queries, extracting the parse function from the full graphql library (which is 1.8MB) into a 70KB unminified package. Version 1.0.0 is stable with no recent updates; it throws GraphQLError on syntax errors and is ideal when you only need parsing without the full GraphQL ecosystem. It ships as CommonJS with no dependencies, but lacks TypeScript types and ESM support.
npm install parse-graphqlNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates parsing a simple GraphQL query into an AST document using the `parse` function.
Create a `index.d.ts` declaration file manually or use `@types/parse-graphql` (unavailable). Consider using the full `graphql` package for TypeScript support.
Use dynamic import: `const { parse } = await import('parse-graphql')` or transpile with bundler. Alternatively, set `"type": "module"` in package.json and use `.cjs` extension for CommonJS.For new projects, consider using `graphql` directly (import { parse } from 'graphql') if bundle size is not critical. For size-sensitive environments, this package is still fine.Use named import: `import { parse } from 'parse-graphql'`Either rename file to `.mjs` or set `"type": "module"` in package.json, or transpile with Babel/TypeScript.
Install: `npm install parse-graphql` and verify import path: `import { parse } from 'parse-graphql'`No dependency data recorded yet.