Registry / devops / easygraphql-parser

easygraphql-parser

JSON →
library0.0.15jsnpmunverified

easygraphql-parser is a Node.js library (v0.0.15, last updated in 2020) that parses a GraphQL schema string into a plain JavaScript object, breaking down types, fields, nullability, arrays, and deprecation. It is part of the EasyGraphQL ecosystem, providing a lightweight alternative to more complex parsers like graphql-js's parse. The library is in maintenance mode, with no recent releases. Key differentiator: outputs a simple, digestible object without requiring full GraphQL execution, making it useful for code generation or schema analysis tools.

npm install easygraphql-parser
INSTALL
IMPORT
SIG · EASYGRAPHQL-PARSER
E
easygraphql-parser
devopsjavascriptv0.0.15
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
import parser from 'easygraphql-parser'
const parser = require('easygraphql-parser'); const schema = parser(schemaCode); // works but wrong style in ESM
Default export is a function that takes a schema string (IDL syntax) and returns an object.
parser as require
const parser = require('easygraphql-parser')
const parser = require('easygraphql-parser').default
CommonJS require works; do not use .default as it's not a named export.
Named exported (none)
import parser from 'easygraphql-parser'
import { parser } from 'easygraphql-parser'
No named exports; only default export exists.

Parses a GraphQL schema file into a JavaScript object and logs the fields of the Family type.

import fs from 'fs'; import path from 'path'; import parser from 'easygraphql-parser'; const schemaCode = fs.readFileSync(path.join(__dirname, 'schema.gql'), 'utf8'); const schema = parser(schemaCode); console.log(schema.Family.fields); // Outputs an array of field objects with name, noNull, isArray, etc.
Debug
Known issues
deprecatedPackage has not been updated since 2020; consider using graphql-js built-in parse or external libraries like graphql-codegen.
fix
Migrate to graphql-js: import { parse, print } from 'graphql'; const ast = parse(schemaCode);
affects: all
breakingRequires GraphQL 0.13, 14, or 15; incompatible with graphql@16+ due to import changes.
fix
Downgrade graphql to 15.x or use a different parser.
affects: >=0.0.1
gotchaThe parser does not support directives or schema types beyond object types, enums, scalars, and interfaces (partial).
fix
Preprocess schema to remove unsupported features or use graphql-js parse for full AST.
affects: all
Errors
Common errors & fixes
Cannot find module 'graphql'
Missing peer dependency graphql.
fix
Run: npm install graphql@15
TypeError: parser is not a function
Importing named export { parser } instead of default.
fix
Use: import parser from 'easygraphql-parser'
TypeError: easygraphqlSchemaParser is not a function
Using require with lowercase but package export is function.
fix
Ensure const parser = require('easygraphql-parser'); parser(schema);
Upgrade
Version history
0.0.15latest on npm
Audit
Dependencies
graphqlrequiredPeer dependency used for parsing the schema (graphql.parse is used internally)
Agent activity
9 hits · last 30 days
node
8
Amazon
1
Resources
easygraphql-parser — npm install easygraphql-parser · libregistry