GraphQL.js

The JavaScript reference implementation of GraphQL for building type schemas and executing queries.

Library
npm
v17.0.2
20,344stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
95/100Excellent
Development Activity92
Maintenance96
Community92
Maturity60
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
94/100Excellent
Architecture95
Code Quality97
Innovation93
Learning Curve82

GraphQL.js is the official JavaScript reference implementation of GraphQL, the query language for APIs created at Facebook. It provides everything you need to define a GraphQL type schema that maps to your data and to serve queries against that schema, all from a single dependency-free npm package.

The library exposes a complete request pipeline — parsing a query string into an AST, validating it against the schema, and executing it to produce a result — along with the building blocks (schema types, directives, introspection, and validation rules) that power the wider GraphQL server and client ecosystem. It runs in Node.js and the browser and ships both CommonJS and ES module builds.

What You Get

  • A schema construction API (GraphQLSchema, GraphQLObjectType, scalars, and directives) for describing your types and fields in code
  • A full request pipeline that parses, validates, and executes GraphQL queries with clear, structured error reporting
  • Standalone language tooling — lexer, parser, printer, and AST visitor — for building and transforming GraphQL documents
  • Built-in schema introspection and a comprehensive set of specification-compliant validation rules
  • Dual CommonJS and ES module builds that work in Node.js and the browser with tree-shaking support

Common Use Cases

  • Powering GraphQL server frameworks and gateways that need a spec-compliant execution engine
  • Building developer tools such as linters, code generators, and IDE integrations on top of the parser and AST
  • Programmatically constructing or transforming schemas and validating queries in build pipelines
  • Running GraphQL queries in the browser or edge runtimes without a separate server

Under The Hood

Architecture

GraphQL.js is organized as a set of focused submodules that mirror the GraphQL request lifecycle. src/language holds the lexer (lexer.ts), parser (parser.ts), printer, and AST visitor; src/type defines the schema system (schema.ts, definition.ts, directives.ts, introspection.ts) plus schema validation (validate.ts); src/validation supplies the specified validation rules and the ValidationContext; and src/execution contains the executor (Executor.ts, execute.ts), field collection, value coercion, and support for incremental delivery. The root src/graphql.ts stitches these together into the high-level graphql/graphqlSync pipeline that parses a source string, validates the resulting document against the schema, and executes it, returning a structured { data, errors } result. src/index.ts re-exports the public surface so consumers can import from graphql or from module-specific entry points like graphql/language.

Tech Stack

The library is written entirely in TypeScript targeting modern Node.js (22+), with no runtime production dependencies. It builds distributable CommonJS (.js) and ES module (.mjs) outputs plus a Deno/JSR distribution via scripts in resources/, and the exports map in package.json routes runtimes and bundlers to the right files. Development tooling includes ESLint, Prettier, cspell, and the native node --test runner.

Code Quality

Code quality is exceptional. The repository contains 167 -test.ts files colocated under __tests__ directories, and the test script enforces 100% line, branch, and function coverage. The full test task chains linting, TypeScript type-checking, a Deno publish dry-run, coverage-gated tests, Prettier checks, spell-checking, and integration tests, giving a rigorous, multi-layered quality bar. Naming is consistent and every public module carries a README.

API Design

The public API is deliberately ergonomic: a single graphql package re-exports the entire surface, while power users can reach for narrower entry points such as graphql/language, graphql/type, and graphql/execution. Schema construction reads declaratively, the graphql({ schema, source }) call returns a promise resolving to a spec-shaped result, and errors surface with precise source locations. Extensive TypeScript types and thorough per-module documentation keep the developer experience approachable despite the breadth of the surface.

Used by 45 apps in this directory

TypeScript
87%
Other

AFFiNE

Productivity · Project Management · Note Taking

72,238

Write, draw, and plan in one infinite canvas — the open-source alternative to Notion and Miro that keeps your data yours.

View details
91
Repo Health
87
Technical
67
Dependency
Built with
TypeScript87%
Updated yesterday
TypeScript
96%
Other

Amplication

Developer Tools · AI Code Assistants · Automation

16,011

Create production-ready backend services with your organization's standards baked in — generating NestJS, Prisma, and GraphQL code that you own and control.

View details
60
Repo Health
84
Technical
60
Dependency
Built with
TypeScript96%
Updated 2 months ago
JavaScript
95%
MIT

AnythingLLM

Developer Tools · Automation · AI Assistants

65,696

The all-in-one AI platform for private document chat, no-code agents, and local LLMs with zero setup friction.

View details
90
Repo Health
78
Technical
64
Dependency
Built with
JavaScript95%
Updated 3 days ago
TypeScript
68%
Apache 2.0

Appsmith

Developer Tools · Automation · No Code Platforms

40,825

Open-source low-code platform to build admin panels, dashboards, and internal tools connected to any database or API.

View details
93
Repo Health
79
Technical
66
Dependency
Built with
TypeScript68%
Java21%
Updated 3 days ago
TypeScript
49%
MPL 2.0

Artillery

Devops · Developer Tools

9,071

Cloud-scale load testing and functional testing for APIs, WebSockets, gRPC, and headless browsers, distributed across AWS Lambda or Fargate with zero infrastructure to manage.

View details
88
Repo Health
73
Technical
68
Dependency
Built with
TypeScript49%
JavaScript48%
Updated 1 weeks ago
Go
54%
Apache 2.0

Authgear

Authentication

2,028

Open-source, self-hostable authentication platform with passkeys, biometric login, SSO, MFA, and GraphQL admin API — a full Auth0/Clerk/Firebase alternative for SaaS and mobile apps.

View details
88
Repo Health
81
Technical
68
Dependency
Built with
Go54%
HTML25%
TypeScript18%
Updated 3 days ago
TypeScript
46%
AGPL 3.0

BrowserOS

Browser · AI Assistants

13,577

The open-source agentic Chromium browser with native AI agents, MCP server, and visual workflow automation — your data never leaves your machine.

View details
87
Repo Health
82
Technical
68
Dependency
Built with
TypeScript46%
Rust22%
Python18%
Updated yesterday
JavaScript
90%
Other

CodeSandbox

Code Editors · Developer Tools

13,640

Instantly ready browser-based IDE that runs full npm dependency resolution and transpilation entirely client-side, with no server needed.

View details
69
Repo Health
76
Technical
62
Dependency
Built with
JavaScript90%
Updated 1 weeks ago
TypeScript
93%
AGPL 3.0

CourseLit

Ecommerce · Blogging

1,262

Open-source, self-hosted LMS for selling online courses, digital downloads, and building communities on your own branded website.

View details
75
Repo Health
74
Technical
71
Dependency
Built with
TypeScript93%
Updated 1 months ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search