Join us from October 8-10 in New York City to learn the latest tips, trends, and news about GraphQL Federation and API platform engineering.Join us for GraphQL Summit 2024 in NYC
Start for Free
Apollo Server 2 is officially end-of-life as of 22 October 2023. Learn more about upgrading.

API Reference: Schema reporting plugin

Using the plugin

This API reference documents the ApolloServerPluginSchemaReporting plugin.

This plugin enables your to register its latest schema with the Apollo schema registry every time it starts up. Full details on schema reporting can be found in the Apollo Studio docs.

Schema reporting does not currently support graphs that use Apollo Federation. This plugin will not work if your is a federated or a composed federated graph running in a gateway. If you have a federated graph, you will need to register schema via the CLI; see Setting up managed federation.

In order to use this plugin, you must configure your server with a , either with the APOLLO_KEY environment variable or by passing it directly to your ApolloServer with new ApolloServer({apollo: {key: KEY}}). (This is the same way you configure your ApolloServer to enable usage reporting.)

If you just want to turn on schema reporting with its default configuration, you can set the APOLLO_SCHEMA_REPORTING environment variable to true. If you want to configure schema reporting (or prefer your setup to be via code rather than environment variables), import ApolloServerPluginSchemaReporting from the apollo-server-core package and pass it to your ApolloServer in the plugins array:

import { ApolloServer } from "apollo-server";
import { ApolloServerPluginSchemaReporting } from "apollo-server-core";
const server = new ApolloServer({
plugins: [

This plugin was introduced in 2.18. In previous versions, schema reporting was configured using the engine option to the ApolloServer constructor. That option continues to work; see the migration guide for details.


Name /


The schema reporter waits before starting reporting. By default, the report waits some random amount of time between 0 and 10 seconds. A longer interval leads to more staggered starts which means it is less likely multiple servers will get asked to upload the same schema.

If this server runs in lambda or in other constrained environments it would be useful to decrease the schema reporting max wait time to be less than default.

This number will be the max for the range in ms that the schema reporter will wait before starting to report.



Override the reported schema that is reported to the Apollo registry. This schema does not go through any and the string is directly sent to the Apollo registry. This can be useful for comments or other ordering and whitespace changes that get stripped when generating a GraphQLSchema.

If you pass this option to this plugin, you should explicitly configure ApolloServerPluginUsageReporting and pass the same value to its overrideReportedSchema option. This ensures that the schema ID associated with requests reported by the usage reporting plugin matches the schema ID that this plugin reports. For example:

new ApolloServer({
plugins: [
overrideReportedSchema: schema
overrideReportedSchema: schema


The URL to use for reporting schemas. Primarily for testing and internal Apollo use.


typeof fetch

Specifies which Fetch API function implementation to use when reporting schemas.

Usage reporting plugin
Inline trace plugin
Rate articleRateEdit on GitHubEditForumsDiscord

© 2024 Apollo Graph Inc., d/b/a Apollo GraphQL.

Privacy Policy