Crate apollo_router

source ·
Expand description

Components of a federated GraphQL Server.

Most of these modules are of varying interest to different audiences.

If your interests are confined to developing plugins, then the following modules are likely to be of most interest to you:

  • self - this module (apollo_router) contains high level building blocks for a federated GraphQL router

  • graphql - graphql specific functionality for requests, responses, errors

  • layers - examples of tower layers used to implement plugins

  • plugin - various APIs for implementing a plugin

  • services - the various services handling a GraphQL requests, and APIs for plugins to intercept them

Modules

Types related to GraphQL requests, responses, etc.
Reusable layers Layers that are specific to one plugin should not be placed in this module.
Plugin system for the router.
Implementation of the various steps in the router’s processing pipeline.
Trace Ids for the router.

Macros

Register a plugin with a group and a name Grouping prevent name clashes for plugins, so choose something unique, like your domain name. Plugins will appear in the configuration as a layer property called: {group}.{name}

Structs

The configuration for the router.
A map of arbitrary JSON values, for use by plugins.
A path and a handler to be exposed as a web_endpoint for plugins
Entry point into creating a router executable with more customization than main.
a list of subgraphs with pregenerated responses
The entry point for running the Router’s HTTP server.
Builder for the part of an Apollo Router that handles GraphQL requests, as a tower::Service.

Enums

Error types for FederatedServer.
The user supplied config. Either a static instance or a stream for hot reloading.
Entitlement controls availability of certain features of the Router. This API experimental and is subject to change outside of semver.
Listening address.
The user supplied schema. Either a static string or a stream for hot reloading.
Specifies when the Router’s HTTP server should gracefully shutdown

Functions

This is the main router entrypoint.