GraphQL.js implements the GraphQL specification for JavaScript and TypeScript. It supplies parsing, validation, execution, and schema building for servers, clients, and tools.
Overview
GraphQL.js is the official JavaScript implementation of the GraphQL specification. It provides the parser, validator, executor, type system, and utilities needed to define schemas and run queries in JavaScript and TypeScript environments.
Developers install it from npm and map a GraphQL type schema to their codebase, then serve query results through the graphql function. That entry point checks syntax and semantics before execution and surfaces errors when a query is invalid.
The package works in Node.js servers and in browsers, and ships with both CommonJS and ES module builds so bundlers can include only the APIs in use. GraphiQL and other GraphQL tooling builds on this library.
Documentation covers schema construction, operation execution, error handling, testing, and production deployment. Upgrade guides walk through major version changes when moving between release lines.
Key features
- GraphQL type schema construction
- Query parsing and validation
- Query execution with resolvers
- CommonJS and ES module builds
- Node.js and browser runtimes
- Schema and operation utilities
- Release upgrade guides
- Experimental specification features
Use cases
- Building GraphQL API servers
- Validating GraphQL operations
- Embedding GraphQL in browser apps
- Powering GraphQL developer tools