GraphQL.js

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

Library
npm
v17.0.2
20,339 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
95 /100 Excellent
Development Activity 100
Maintenance 96
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 46 apps in this directory

Go
36%

OpenPanel

Devops · Hosting Control Panel

764

Docker-powered web hosting control panel that gives every user a fully isolated environment with dedicated web server, database, and networking — VPS-grade security on shared hardware.

View details
87
Repo Health
75
Technical
63
Dependency
Built with
Go 36%
HTML 30%
TypeScript 24%
Updated 1 weeks ago
JavaScript
98%
Apache 2.0

Parse Server

Databases · Developer Tools

21,401

Self-hosted Backend-as-a-Service for Node.js with REST, GraphQL, real-time Live Query, cloud code, and pluggable adapters for any infrastructure.

View details
98
Repo Health
81
Technical
70
Dependency
Built with
JavaScript 98%
Updated 1 weeks ago
TypeScript
96%
MIT

Payload CMS

Blogging · CMS · Developer Tools

45,458

The open-source, Next.js-native headless CMS that lives inside your /app folder and gives you a full TypeScript backend instantly.

View details
92
Repo Health
88
Technical
65
Dependency
Built with
TypeScript 96%
Updated 6 days ago
TypeScript
96%
Apache 2.0

Pezzo

AI Development · Monitoring

3,278

Open-source LLMOps platform for prompt management, AI observability, intelligent caching, and real-time cost tracking across LLM providers.

View details
59
Repo Health
75
Technical
66
Dependency
Built with
TypeScript 96%
Updated 2 months ago
TypeScript
50%
Other

Phase Console

Devops · Security

931

End-to-end encrypted secrets management for engineering teams — from local dev to Kubernetes production.

View details
85
Repo Health
73
Technical
63
Dependency
Built with
TypeScript 50%
Python 48%
Updated 1 weeks ago
Python
49%
Other

Arize Phoenix

Analytics · Devops · Monitoring

11,976

Open-source AI observability platform for tracing, evaluating, and debugging LLM applications with built-in intelligence and MCP support.

View details
92
Repo Health
88
Technical
67
Dependency
Built with
Python 49%
TypeScript 43%
Updated 6 days ago
TypeScript
90%
MIT

Plasmic

CMS · Design Tools · Low Code Platforms

7,125

The open-source visual builder that lets teams design React apps and websites with drag-and-drop while integrating seamlessly with your codebase.

View details
81
Repo Health
78
Technical
64
Dependency
Built with
TypeScript 90%
Updated 1 weeks ago
Go
68%
MIT

Probo

Automation · Security

1,476

Open-source GRC platform for engineering and security teams.

View details
87
Repo Health
90
Technical
69
Dependency
Built with
Go 68%
TypeScript 30%
Updated 1 weeks ago
Python
100%
Other

Sourcebot

AI Code Assistants · Developer Tools · Search

4,005

A self-hosted, AI-powered code search engine that indexes every repo across GitHub, GitLab, Bitbucket, Gitea, Gerrit, and Azure DevOps, so both engineers and coding agents can search, browse, and ask questions about your codebase from one place.

View details
86
Repo Health
83
Technical
61
Dependency
Built with
Python 100%
Updated 1 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