GraphQL.js

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

Library
npm
v17.0.2
20,346 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
81 /100 Excellent
Development Activity 68
Maintenance 72
Community 84
Maturity 60
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
94 /100 Excellent
Architecture 95
Code Quality 97
Innovation 93
Learning Curve 82

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
82%
Other

AFFiNE

Collaboration · Note Taking · Productivity

73,040

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
TypeScript 82%
Rust 11%
Updated 5 days ago
TypeScript
96%
Other

Amplication

AI Code Assistants · Automation · Developer Tools

16,015

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
58
Repo Health
84
Technical
60
Dependency
Built with
TypeScript 96%
Updated 3 months ago
JavaScript
95%
MIT

AnythingLLM

AI Assistants · Automation · Developer Tools

66,533

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
JavaScript 95%
Updated 6 days ago
TypeScript
68%
Apache 2.0

Appsmith

Automation · Developer Tools · No Code Platforms

40,959

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
TypeScript 68%
Java 21%
Updated 6 days ago
TypeScript
49%
MPL 2.0

Artillery

Developer Tools · Devops

9,083

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
TypeScript 49%
JavaScript 48%
Updated 1 weeks ago
Go
55%
Apache 2.0

Authgear

Authentication

2,074

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
Go 55%
HTML 24%
TypeScript 18%
Updated 1 weeks ago
TypeScript
45%
AGPL 3.0

BrowserOS

AI Assistants · Browser

13,763

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
TypeScript 45%
Rust 23%
Python 18%
Updated 4 days ago
JavaScript
90%
Other

CodeSandbox

Code Editors · Developer Tools

13,650

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

View details
67
Repo Health
76
Technical
62
Dependency
Built with
JavaScript 90%
Updated 3 weeks ago
TypeScript
93%
AGPL 3.0

CourseLit

Blogging · Ecommerce

1,268

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

View details
77
Repo Health
74
Technical
68
Dependency
Built with
TypeScript 93%
Updated 5 days 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