Apollo Solutions

Apollo-built examples and tools to help you along your GraphQL journey.


The Apollo Solutions team has created a collection of tools and examples to support developers on their GraphQL journey. These solutions, hosted on GitHub, showcase best practices, provide helpful utilities, and simplify common tasks with ready-to-use CLI tools and example implementations.

note
The code in these repositories is experimental and has been provided for reference purposes only.

apollo-faker-demo

A CLI tool and development server for the "Dream Query" workflow.

GitHub: https://github.com/apollosolutions/apollo-faker-demo


apq-hasher

A tool for generating APQ hashes for a given operation using Apollo Client.

GitHub: https://github.com/apollosolutions/apq-hasher


ariadne-federated-traces

An example of how to add support for federated tracing to Python-based subgraphs using Ariadne as a GraphQL Server.

GitHub: https://github.com/apollosolutions/ariadne-federated-traces


entity-requests-from-queryplan

A CLI that generates a list of _entities requests that are part of the query plan for a given operation, along with their required input variables.

GitHub: https://github.com/apollosolutions/entity-requests-from-queryplan


example-coprocessor-auth-policy

A demonstration of how to set up a coprocessor with the router to evaluate policy-based authorization with the @policy directive. Note that this repo currently does not enforce authentication via a JWT or other token for the sake of simplicity. In production code, you would likely have a consumer-provided token in a header, which would be passed down to the auth service.

GitHub: https://github.com/apollosolutions/example-coprocessor-auth-policy


example-coprocessor-custom-auth-directive

A demonstration of how to set up a JS coprocessor that applies some custom auth checks.

GitHub: https://github.com/apollosolutions/example-coprocessor-custom-auth-directive


example-coprocessor-external-auth

A demonstration of how to set up a router coprocessor for external authentication. This can be used for service-to-service authentication, populating claims based on an opaque token, enriching a JWT with additional scopes, and more.

GitHub: https://github.com/apollosolutions/example-coprocessor-external-auth


example-coprocessor-helloworld

A basic coprocessor example that simply logs the Apollo Router's payload.

GitHub: https://github.com/apollosolutions/example-coprocessor-helloworld


example-jwtauthentication

A demonstration of how to use JWT authentication in the router with the @requiresScopes directive when the JWT uses the standard scope JWT claim.

GitHub: https://github.com/apollosolutions/example-jwtauthentication


example-rhai-client-id-validation

A minimal example Rhai script that validates incoming requests containing the apollographql-client-name and apollographql-client-version headers used for metrics collection with GraphOS.

GitHub: https://github.com/apollosolutions/example-rhai-client-id-validation


example-rhai-normalizejwtscopes

A demonstration of how to use JWT authentication in the router with the @requiresScopes directive when the JWT does not use the standard scope JWT claim. In this example, it is instead stored as an array of strings on an authorizations claim in the JWT. The Rhai script in this repo converts it to the format expected by the router.

GitHub: https://github.com/apollosolutions/example-rhai-normalizejwtscopes


example-subgraph-mongodb

A demonstration of connecting MongoDB Atlas from a subgraph and making the data available via the router. The repo demonstrates how you can expose and pass down a MongoDB-like filter for filtering returned data, as well as, a more demand-driven approach of using specific GraphQL arguments.

GitHub: https://github.com/apollosolutions/example-subgraph-mongodb


expand-schema-tags

A script that enables tagging all elements of a schema by adding a tag to the schema definition itself.

GitHub: https://github.com/apollosolutions/expand-schema-tags


federation-2-readiness

A CLI tool to check your federated schema for backward compatibility with Federation 2 and audit query plans.

GitHub: https://github.com/apollosolutions/federation-2-readiness


financial-supergraph

A demonstration supergraph for a financial services company. Use the schema as inspiration for your own financial supergraph!

GitHub: https://github.com/apollosolutions/financial-supergraph


graphql-data-dictionary

A CLI that converts GraphQL SDL into a CSV that is other data management systems can consume. The CSV will add information about subgraphs if provided a supergraph schema file.

GitHub: https://github.com/apollosolutions/graphql-data-dictionary


media-supergraph

A demonstration supergraph for a media business containing media and users subgraphs. Use the schema as inspiration for your own media supergraph!

GitHub: https://github.com/apollosolutions/media-supergraph


reference-architecture

A reference architecture with Kubernetes when using Apollo Federation. It uses GitHub Actions configured to automate most of the deployment processes for the router, subgraphs, and client, along with minimal observability tooling to load test the resulting environment.

GitHub: https://github.com/apollosolutions/reference-architecture


retail-supergraph

A demonstration supergraph for a retail business containing checkout, discovery, inventory, orders, products, reviews, shipping, and users subgraphs. Use the schema as inspiration for your own retail supergraph!

GitHub: https://github.com/apollosolutions/retail-supergraph


rhai-test

rhai-test is an experimental CLI tool for running unit tests against your Router rhai scripts. It allows you to write unit tests in Rhai that feel familiar and natural, and provides not only the mechanism to write and run the tests, but also utilities for mocking Apollo-provided functionality that allow you to fully test against the Router lifecycle.

GitHub: https://github.com/apollosolutions/rhai-test


router-extensibility-load-testing

The repository provides a way to test the overhead of the three customization points of the Apollo Router, including coprocessors, Rhai, and native functionality.

GitHub: https://github.com/apollosolutions/router-extensibility-load-testing


router-jwks-generator

A CLI tool to generate a JWKS file for use with the router authentication plugin.

GitHub: https://github.com/apollosolutions/router-jwks-generator


router-node-proxy

An example of how to run both @apollo/gateway and Apollo Router and use the gateway Node.js server to conditionally proxy traffic to the router to support a gradual release strategy. It uses Unleash to demonstrate a somewhat realistic feature toggle system.

GitHub: https://github.com/apollosolutions/router-node-proxy


rover-actions

A GitHub Action to install the Apollo Rover CLI on GitHub action runners. Once installed, rover is added to PATH, so it can be used in subsequent steps.

GitHub: https://github.com/apollosolutions/rover-actions


schema-shaker

A tool to reduce the subgraphs to only the necessary elements for operations and query planning by "tree shaking" the supergraph.

GitHub: https://github.com/apollosolutions/schema-shaker


travel-supergraph

A demonstration supergraph for a travel company. Use the schema as inspiration for your own travel supergraph!

GitHub: https://github.com/apollosolutions/travel-supergraph


Feedback

Forums