Gathering detailed insights and metrics for @apollo/server
Gathering detailed insights and metrics for @apollo/server
Gathering detailed insights and metrics for @apollo/server
Gathering detailed insights and metrics for @apollo/server
🌍 Spec-compliant and production ready JavaScript GraphQL server that lets you develop in a schema-first way. Built for Express, Connect, Hapi, Koa, and more.
npm install @apollo/server
Typescript
Module System
Min. Node Version
Node Version
NPM Version
82.4
Supply Chain
96.8
Quality
86
Maintenance
100
Vulnerability
98.9
License
@apollo/server-gateway-interface@2.0.0
Updated on Jul 17, 2025
@apollo/server@5.0.0
Updated on Jul 17, 2025
@apollo/server-plugin-response-cache@5.0.0
Updated on Jul 17, 2025
@apollo/server-integration-testsuite@5.0.0
Updated on Jul 17, 2025
@apollo/server-plugin-response-cache@5.0.0-rc.0
Updated on Jul 07, 2025
@apollo/server-gateway-interface@2.0.0-rc.0
Updated on Jul 07, 2025
TypeScript (55.97%)
JavaScript (43.63%)
Shell (0.39%)
Total Downloads
104,750,781
Last Day
37,914
Last Week
1,219,571
Last Month
5,082,359
Last Year
56,675,340
MIT License
13,909 Stars
8,534 Commits
2,018 Forks
197 Watchers
88 Branches
576 Contributors
Updated on Sep 02, 2025
Latest Version
5.0.0
Package Id
@apollo/server@5.0.0
Unpacked Size
2.07 MB
Size
364.35 kB
File Count
547
NPM Version
10.9.2
Node Version
22.17.0
Published on
Jul 17, 2025
Cumulative downloads
Total Downloads
Last Day
2.2%
37,914
Compared to previous day
Last Week
0.9%
1,219,571
Compared to previous week
Last Month
-6.5%
5,082,359
Compared to previous month
Last Year
46.8%
56,675,340
Compared to previous year
20
1
@apollo/server
This
@apollo/server
package is new since Apollo Server 4. Previous major versions of Apollo Server used a set of package names starting withapollo-server
, such asapollo-server
,apollo-server-express
,apollo-server-core
, etc.
Announcement: Join 1000+ engineers at GraphQL Summit 2025 by Apollo for talks, workshops, and office hours. Oct 6-8, 2025 in San Francisco. Get your pass here ->
Apollo Server is an open-source, spec-compliant GraphQL server that's compatible with any GraphQL client, including Apollo Client. It's the best way to build a production-ready, self-documenting GraphQL API that can use data from any source.
You can use Apollo Server as:
Apollo Server provides a simple API for integrating with any Node.js web framework or serverless environment. The @apollo/server
package itself ships with a minimally-configurable, standalone web server which handles CORS and body parsing out of the box. Integrations with other environments are community-maintained.
Apollo Server provides:
Full documentation for Apollo Server is available on our documentation site. This README shows the basics of getting a server running (both standalone and with Express), but most features are only documented on our docs site.
You can also check out the getting started guide in the Apollo Server docs for more details, including examples in both TypeScript and JavaScript.
Apollo Server's standalone server lets you get a GraphQL server up and running quickly without needing to set up an HTTP server yourself. It allows all the same configuration of GraphQL logic as the Express integration, but does not provide the ability to make fine-grained tweaks to the HTTP-specific behavior of your server.
First, install Apollo Server and the JavaScript implementation of the core GraphQL algorithms:
npm install @apollo/server graphql
Then, write the following to server.mjs
. (By using the .mjs
extension, Node lets you use the await
keyword at the top level.)
1import { ApolloServer } from '@apollo/server'; 2import { startStandaloneServer } from '@apollo/server/standalone'; 3 4// The GraphQL schema 5const typeDefs = `#graphql 6 type Query { 7 hello: String 8 } 9`; 10 11// A map of functions which return data for the schema. 12const resolvers = { 13 Query: { 14 hello: () => 'world', 15 }, 16}; 17 18const server = new ApolloServer({ 19 typeDefs, 20 resolvers, 21}); 22 23const { url } = await startStandaloneServer(server); 24console.log(`🚀 Server ready at ${url}`);
Now run your server with:
node server.mjs
Open the URL it prints in a web browser. It will show Apollo Sandbox, a web-based tool for running GraphQL operations. Try running the operation query { hello }
!
Apollo Server's Express middleware lets you run your GraphQL server as part of an app built with Express, the most popular web framework for Node.
First, install Apollo Server, its Express middleware, the JavaScript implementation of the core GraphQL algorithms, Express, and the standard Express middleware package for CORS headers:
npm install @apollo/server @as-integrations/express5 graphql express cors
If using Typescript you may also need to install additional type declaration packages as development dependencies to avoid common errors when importing the above packages (i.e. Could not find a declaration file for module 'cors
'):
npm install --save-dev @types/cors @types/express
Then, write the following to server.mjs
. (By using the .mjs
extension, Node lets you use the await
keyword at the top level.)
1import { ApolloServer } from '@apollo/server'; 2import { expressMiddleware } from '@as-integrations/express5'; 3import { ApolloServerPluginDrainHttpServer } from '@apollo/server/plugin/drainHttpServer' 4import express from 'express'; 5import http from 'http'; 6import cors from 'cors'; 7 8// The GraphQL schema 9const typeDefs = `#graphql 10 type Query { 11 hello: String 12 } 13`; 14 15// A map of functions which return data for the schema. 16const resolvers = { 17 Query: { 18 hello: () => 'world', 19 }, 20}; 21 22const app = express(); 23const httpServer = http.createServer(app); 24 25// Set up Apollo Server 26const server = new ApolloServer({ 27 typeDefs, 28 resolvers, 29 plugins: [ApolloServerPluginDrainHttpServer({ httpServer })], 30}); 31await server.start(); 32 33app.use( 34 cors(), 35 express.json(), 36 expressMiddleware(server), 37); 38 39await new Promise((resolve) => httpServer.listen({ port: 4000 }, resolve)); 40console.log(`🚀 Server ready at http://localhost:4000`);
Now run your server with:
node server.mjs
Open the URL it prints in a web browser. It will show Apollo Sandbox, a web-based tool for running GraphQL operations. Try running the operation query { hello }
!
No vulnerabilities found.