Server

A production-ready GraphQL layer over any backend

Apollo Server is an open-source solution with all the features you need to take your GraphQL API from from prototype to production.
const { ApolloServer, gql } = require('apollo-server');

const typeDefs = gql`
  type Query { hello: String }
`;

const resolvers = {
  Query: { hello: () => 'world' },
};

const server = new ApolloServer({ typeDefs, resolvers });

server.listen()
  .then(() => console.log('Server started! 🚀'));

Build and run a performant, scalable GraphQL layer with just a few lines of code.

Apollo Server helps you build a GraphQL layer over your existing REST APIs and databases. It's simple to get started:

  1. Describe the data your services have with a schema
  2. Implement your schema with resolvers that fetch data from your existing backend
  3. Start your server! Apollo Server wires up everything for you.

Apollo Server is written in JavaScript to enable cutting-edge features like caching, tracing, and execution on the edge.

Try it out

All the features you need in production

Apollo Server's features reflect industry best practices so you can run and deploy a GraphQL layer with confidence.

Schema-first approach

Describe the data your services have in a schema, and fill in business logic with resolver functions.

Learn more

CDN integration

Easily cache whole query responses in your CDN with zero-config automatic persisted queries.

Learn more

One-step mocking

Mock your GraphQL schema with one line of code, so you can develop your UI in parallel with the API.

Learn more

Realtime data

Add event-based data streaming to your API with GraphQL subscriptions, enabling realtime features.

Learn more

Performance and error reporting

Gain valuable insights into your GraphQL layer without any additional infrastructure.

Learn more

Advanced caching

Build a performant API without overworking underlying REST services with partial query caching.

Learn more

Layer GraphQL over existing REST APIs

Adopt GraphQL incrementally by using the Apollo Server Data Source API to quickly hook up backend services.

Try it now on Glitch!