liveBook · Manning

ApolloServer

As explained in Contract Testing in Action

An open-source library for building server-side GraphQL applications.

ApolloServer is an open-source JavaScript library for building server-side GraphQL applications. It acts as the provider behind a GraphQL endpoint, exposing a schema, resolvers, and data sources for consumer queries. section 7.2 section 7.2.1

Movies GraphQL API

A movies service defines Movie and Query types, then maps the movies and movie(movieId) queries to MovieAPI methods that fetch data from REST endpoints. ApolloServer combines the type definitions and resolvers, injects MovieAPI through the server context, and starts a standalone GraphQL server. section 7.2.1

Figure 7.3 GraphQL API at a glance with all the relevant files
figure

Use the project overview to trace the GraphQL server alongside its data source, consumers, provider, and contract files. section 7.2.1

How Contract Testing in Action covers it

How deep it goes
Explains schema, resolvers, data sources, context, and startup, while deferring differences between Apollo Server 3 and 4.
Examples
Uses a movies API with Movie types, movie queries, MovieAPI methods, REST endpoints, and a standalone server.
What you can do after
Build it from scratch by defining a GraphQL schema, wiring resolvers to data sources, configuring context, and starting ApolloServer.
How it connects
Connects GraphQL schemas and resolvers with REST data sources, Apollo Client consumers, and contract testing.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Contract Testing in Action. The section links point to the parts of the book it draws on.