Schema Registry
GraphQL Schema Registry is a service that allows you to store and manage your GraphQL schemas. You can use GraphQL Mesh to serve your supergraph schemas stored in a schema registry, or send usage data to a schema registry.
A schema registry is usually recommended for;
- Observability for operation performance
- Schema usage and coverage to understand which fields are used and how often.
- Breaking changes, validation and schema evolution to understand the impact of changes on the client
Built-in Integration
GraphQL Mesh supports the following schema registry integrations without any additional configuration:
Custom Integration
You can also use a custom schema registry by providing a configuration object, along with other options to customize the polling/retry behavior.
mesh.config.ts
import { defineConfig as defineServeConfig } from '@graphql-mesh/serve-cli'
export default defineServeConfig({
supergraph: () =>
// Fetch the supergraph from the schema registry
fetch('https://my-registry.com/supergraph.graphql', {
headers: {
Authorization: 'Bearer MY_TOKEN'
}
}).then(res => res.text()),
// Poll the schema registry every 10 seconds
polling: 10000,
plugins: ctx => [
// You can also write your custom plugins to interact with the schema registry
useMyCustomPlugin(ctx)
]
})
💡
Refer to the custom plugins docs for more information on how to write custom plugins.