🌐
HTTP1.5M+/wkMIT

@apollo/server

Apollo Server is the most popular GraphQL server implementation for Node.js, providing a production-ready, spec-compliant server that works with any Node.js HTT

Installation

npm
npm install @apollo/server graphql
yarn
yarn add @apollo/server graphql
pnpm
pnpm add @apollo/server graphql

Import

ESM
import { ApolloServer } from '@apollo/server';

Quick Example

usage
import { ApolloServer } from '@apollo/server';

const server = new ApolloServer({
  typeDefs: `type Query { hello: String }`,
  resolvers: {
    Query: { hello: () => 'Hello world' },
  },
});

await server.start();

About @apollo/server

Apollo Server is the most popular GraphQL server implementation for Node.js, providing a production-ready, spec-compliant server that works with any Node.js HTTP framework or serverless environment. Apollo Server 4 is framework-agnostic and integrates with Express, Fastify, Koa, AWS Lambda, Google Cloud Functions, Azure Functions, and standalone Node.js HTTP servers. The server provides built-in features for schema definition using SDL (Schema Definition Language), resolver implementation, error formatting, operation tracing, and request batching. Apollo Server supports plugins for extending server behavior with lifecycle hooks covering request parsing, validation, execution, and response formatting. The server integrates with Apollo Studio for schema registry, operation monitoring, performance tracing, and breaking change detection. Advanced features include federated graph support through Apollo Federation for composing multiple GraphQL services into a unified supergraph, response caching, automatic persisted queries for reducing bandwidth, and incremental delivery with @defer and @stream directives. Apollo Server is the recommended GraphQL server for teams building production APIs that need monitoring, federation, and enterprise-grade tooling.

Quick Facts

Package@apollo/server
CategoryHTTP
Weekly Downloads1.5M+
LicenseMIT
Installnpm install @apollo/server graphql

Related Packages

Browse npm Packages by Category

Explore our reference of 200 popular npm packages with install commands, examples, and quick-start guides.