JavaScript GraphQL libraries

Updated Nov 2026

JavaScript GraphQL libraries define a schema for an API and execute GraphQL operations against it. A server library accepts each request over HTTP or WebSocket, then validates and runs the operation through the schema's resolvers. These libraries serve the APIs behind web and mobile apps, partner integrations, and AI agents that query structured data.

Popularity

GraphQL.js has the most monthly downloads in this comparison, at 270.5M.

LibraryMonthly downloadsStarsLast releaseLicense
GraphQL.js
270.5M
20.3KNov 2026MIT
@graphql-tools/schema
94.5M
5.4KNov 2026MIT
graphql-ws
63.9M
1.9KNov 2026MIT
Envelop
45.8M
8.5KNov 2026MIT
Apollo Server
15.2M
14.0KNov 2026MIT
GraphQL Yoga
11.1M
8.5KNov 2026MIT
graphql-http
9.1M
366Sep 2026MIT
Mercurius
1.3M
2.5KNov 2026MIT
Downloads: npm, last thirty days. Stars and releases: GitHub. Amber: no release in over a year.

Features compared

LibraryHTTP request handlerSubscription transportSDL schema building
GraphQL.jsUnsupportedUnsupportedBuilt-in
@graphql-tools/schemaUnsupportedUnsupportedBuilt-in
graphql-wsUnsupportedBuilt-inUnsupported
EnvelopUnsupportedUnsupportedUnsupported
Apollo ServerBuilt-inVia pluginBuilt-in
GraphQL YogaBuilt-inBuilt-inBuilt-in
graphql-httpBuilt-inUnsupportedUnsupported
MercuriusBuilt-inBuilt-inBuilt-in
Built-inVia pluginNot supported

Libraries and code examples

Builds schemas and executes GraphQL operations as the reference JavaScript runtime.

Downloads / mo
270.5M
Stars
20.3K
Last release
17.1.0
License
MIT

Strengths

  • Validates queries before execution. The graphql function validates the query before running its resolvers.
  • Builds schemas directly in code. Define object types and field resolvers with the schema constructors.

Limitations

  • Subscriptions need a transport layer. Connect subscription execution to an event system and network transport.
  • Custom pipelines need validation. Run operation validation separately when building a low-level execution pipeline.

Quickstart

From README.md
$ npm install graphql
import { buildSchema, graphql } from 'graphql';

const schema = buildSchema('type Query { hello: String }');
const result = await graphql({ schema, source: '{ hello }', rootValue: { hello: () => 'world' } });

GraphQL.js examples

From open-source projects on GitHub

@graphql-tools/schema

Builds an executable GraphQL.js schema from type definitions and a resolver map.

Downloads / mo
94.5M
Stars
5.4K
Last release
11.0.9
License
MIT

Strengths

  • Combines types from many files. Split type definitions and resolvers across files and merge them into one schema.
  • Extends existing types. Add fields to the root Query and Mutation types with the extend keyword.

Quickstart

From generate-schema
$ npm install @graphql-tools/schema graphql
import { makeExecutableSchema } from '@graphql-tools/schema';

const schema = makeExecutableSchema({
  typeDefs: 'type Query { hello: String }',
  resolvers: { Query: { hello: () => 'world' } },
});

@graphql-tools/schema examples

From open-source projects on GitHub

Implements the GraphQL over WebSocket Protocol as a server and a client.

Downloads / mo
63.9M
Stars
1.9K
Last release
6.4.3
License
MIT

Strengths

  • Runs many operations on one socket. Separate operation IDs let several operations share one connection at the same time.

Limitations

  • Needs graphql-ws on both sides. Run graphql-ws on the server and the client rather than mixing it with subscriptions-transport-ws.

Quickstart

From ws.ts
$ npm install graphql-ws graphql ws
import { GraphQLObjectType, GraphQLSchema, GraphQLString } from "graphql";
import { WebSocketServer } from "ws";
import { useServer } from "graphql-ws/use/ws";
const schema = new GraphQLSchema({ query: new GraphQLObjectType({ name: "Query", fields: { hello: { type: GraphQLString, resolve: () => "Hello" } } }) });
useServer({ schema }, new WebSocketServer({ port: 4000 }));

graphql-ws examples

From open-source projects on GitHub

Wraps the GraphQL parse, validate, execute, and subscribe functions in a plugin system.

Downloads / mo
45.8M
Stars
8.5K
Last release
6.0.1
License
MIT

Strengths

  • Adds features as plugins. Register each feature, such as a parser cache, as a plugin on the base setup.

Limitations

  • No HTTP server included. Pair Envelop with an HTTP framework or server for production traffic.

Quickstart

From getting-started
$ npm install @envelop/core graphql
import * as graphql from 'graphql';
import { envelop, useEngine, useSchema } from '@envelop/core';

const getEnveloped = envelop({ plugins: [
  useEngine(graphql),
  useSchema(graphql.buildSchema('type Query { hello: String }')),
] });
const { schema, parse, execute, contextFactory } = getEnveloped();
const result = await execute({ schema, document: parse('{ __typename }'), contextValue: await contextFactory() });

Envelop examples

From open-source projects on GitHub

Provides a GraphQL request pipeline with standalone and framework-integrated server options.

Downloads / mo
15.2M
Stars
14.0K
Last release
5.5.2
License
MIT

Strengths

  • Includes a standalone HTTP server. Start a GraphQL endpoint with CORS and body parsing already handled.
  • Caches parsed and validated operations. Reuse validated documents across requests without caching their query results.

Limitations

  • Standalone HTTP customization is limited. Use a framework integration for custom middleware, CORS, or other endpoints.
  • Subscriptions need an additional transport. Add graphql-ws for subscriptions in a non-federated graph.

Quickstart

From README.md
$ npm install @apollo/server 'graphql@^16.11.0'
import { ApolloServer } from '@apollo/server';

const server = new ApolloServer({
  typeDefs: 'type Query { hello: String }',
  resolvers: { Query: { hello: () => 'world' } },
});
await server.start();
const result = await server.executeOperation({ query: '{ hello }' });
await server.stop();

Apollo Server examples

From open-source projects on GitHub

Serves GraphQL through a Fetch-based handler with built-in subscription transport.

Downloads / mo
11.1M
Stars
8.5K
Last release
6.1.0
License
MIT

Strengths

  • Includes subscriptions over server events. Serve subscriptions through the built-in Server-Sent Events transport.
  • Supports Fetch-based deployment hosts. Use the Fetch handler across Node, serverless, and worker environments.

Limitations

  • WebSockets need an additional integration. Add graphql-ws when clients require the WebSocket subscription protocol.
  • Subscription clients must support SSE. Use a compatible GraphQL-over-SSE client for the default subscription transport.

Quickstart

From README.md
$ npm install graphql-yoga graphql
import { createYoga, createSchema } from 'graphql-yoga';

const yoga = createYoga({ schema: createSchema({
  typeDefs: 'type Query { hello: String }',
  resolvers: { Query: { hello: () => 'world' } },
}) });
const response = await yoga.fetch('http://localhost/graphql?query={hello}');

GraphQL Yoga examples

From open-source projects on GitHub

Implements the GraphQL over HTTP spec as a server handler, a client, and an audit suite.

Downloads / mo
9.1M
Stars
366
Last release
1.23.1
License
MIT

Strengths

  • Plugs into Node.js HTTP servers. createHandler returns a request handler for a Node.js HTTP server.

Limitations

  • No subscriptions. Add graphql-ws or graphql-sse for subscriptions.

Quickstart

From README.md
$ npm install graphql-http graphql express
import express from 'express';
import { buildSchema } from 'graphql';
import { createHandler } from 'graphql-http/lib/use/express';

const schema = buildSchema('type Query { hello: String }');
const app = express();
app.all('/graphql', createHandler({ schema, rootValue: { hello: () => 'world' } }));
app.listen(4000);

graphql-http examples

From open-source projects on GitHub

Adds GraphQL execution, endpoints, and subscriptions to a Fastify application.

Downloads / mo
1.3M
Stars
2.5K
Last release
16.12.2
License
MIT

Strengths

  • Combines repeated resolver data requests. Loaders combine resolver requests into bulk queries and can cache results.
  • Caches query parsing and validation. Reuse cached query parsing and validation work.

Limitations

  • Requires a Fastify application. Integrate GraphQL through the Fastify host rather than a standalone runtime.
  • Deferred responses exclude JIT compilation. Choose deferred responses or JIT compilation; they cannot run together.

Quickstart

From README.md
$ npm install mercurius fastify graphql
import Fastify from 'fastify';
import mercurius from 'mercurius';

const app = Fastify();
app.register(mercurius, {
  schema: 'type Query { hello: String }',
  resolvers: { Query: { hello: () => 'world' } },
});
await app.ready();
const result = await app.graphql('{ hello }');
await app.close();

Mercurius examples

From open-source projects on GitHub

FAQ

GraphQL.js supplies the schema and execution runtime that the server libraries build on. For a full HTTP server, Apollo Server and GraphQL Yoga wrap that runtime with request handling and plugins. Mercurius fits an app that already runs on Fastify.

Apollo Server is a GraphQL server for Node.js with a standalone web server that handles CORS and body parsing. A framework integration replaces the standalone server when an app needs custom middleware or other endpoints.

The @graphql-tools/schema package builds an executable GraphQL.js schema from type definitions in the GraphQL schema language and a resolver object, through the makeExecutableSchema function.

graphql-ws implements the GraphQL over WebSocket Protocol as both a server and a client. The server and the client both need graphql-ws, because it does not work with the deprecated subscriptions-transport-ws protocol.

GraphQL Yoga serves GraphQL through a Fetch handler that runs in Node.js, serverless, and worker environments, with subscriptions over Server-Sent Events built in. Apollo Server includes a standalone HTTP server and needs graphql-ws added for subscriptions in a non-federated graph.

Apollo Server does not carry subscriptions on its own. A non-federated graph adds the graphql-ws library to the server for the subscription transport.

For coding agents

Found your GraphQL library? Help your agent use it.

Connect Exa so your coding agent can find the library’s documentation, check its API, and look up implementations while you build.

Run in your terminal

claude plugin install exa@claude-plugins-official