GraphQL.js

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

Library
npm
v17.0.2
20,343stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
97/100Excellent
Development Activity100
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
88%
Other

AFFiNE

Productivity · Project Management · Note Taking

71,668

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
68
Dependency
Built with
TypeScript88%
Updated today
TypeScript
96%
Other

Amplication

Developer Tools · AI Code Assistants · Automation

16,010

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
61
Repo Health
84
Technical
60
Dependency
Built with
TypeScript96%
Updated 1 months ago
JavaScript
95%
MIT

AnythingLLM

Developer Tools · Automation · AI Assistants

64,914

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

View details
91
Repo Health
78
Technical
68
Dependency
Built with
JavaScript95%
Updated today
TypeScript
66%
Apache 2.0

Appsmith

Developer Tools · Automation · No Code Platforms

40,707

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

View details
94
Repo Health
79
Technical
68
Dependency
Built with
TypeScript66%
Java22%
Updated today
TypeScript
49%
MPL 2.0

Artillery

Devops · Developer Tools

9,054

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
89
Repo Health
73
Technical
68
Dependency
Built with
TypeScript49%
JavaScript48%
Updated 5 days ago
Go
55%
Apache 2.0

Authgear

Authentication

1,989

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
72
Dependency
Built with
Go55%
HTML26%
TypeScript17%
Updated yesterday
TypeScript
49%
AGPL 3.0

BrowserOS

Browser · AI Assistants

13,248

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
69
Dependency
Built with
TypeScript49%
Rust22%
Python16%
Updated today
JavaScript
90%
Other

CodeSandbox

Code Editors · Developer Tools

13,633

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

View details
65
Repo Health
76
Technical
63
Dependency
Built with
JavaScript90%
Updated 1 months ago
TypeScript
93%
AGPL 3.0

CourseLit

Ecommerce · Blogging

1,255

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

View details
78
Repo Health
74
Technical
72
Dependency
Built with
TypeScript93%
Updated 4 weeks 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