@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 install @apollo/server graphql
yarn add @apollo/server graphql
pnpm add @apollo/server graphql
Import
import { ApolloServer } from '@apollo/server';Quick Example
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 |
| Category | HTTP |
| Weekly Downloads | 1.5M+ |
| License | MIT |
| Install | npm install @apollo/server graphql |
Related Packages
GraphQL is the JavaScript reference implementation of the GraphQL specification, a query language fo…
GraphQL Yoga is a batteries-included, fully-featured GraphQL server built on top of the Fetch API st…
Express is the most widely used web application framework for Node.js, providing a minimal and flexi…
NestJS is a progressive Node.js framework for building efficient, reliable, and scalable server-side…
tRPC enables you to build fully typesafe APIs without schemas or code generation by leveraging TypeS…
Browse npm Packages by Category
Explore our reference of 200 popular npm packages with install commands, examples, and quick-start guides.