Skip to content

A Mercurius plugin for schema reporting to Apollo Studio

License

Notifications You must be signed in to change notification settings

nearform/mercurius-apollo-registry

Folders and files

NameName
Last commit message
Last commit date
Jan 22, 2024
Feb 8, 2021
Feb 8, 2021
Apr 10, 2021
Feb 8, 2021
Feb 8, 2021
Jan 26, 2021
Jan 26, 2021
Oct 4, 2022
Feb 8, 2021
Feb 8, 2021
Feb 8, 2021
Aug 8, 2023
Feb 8, 2021
Feb 8, 2021
Jun 14, 2022
Jun 10, 2024

Repository files navigation

Mercurius Apollo Registry Plugin

A Mercurius plugin for schema reporting to Apollo Studio.

Installation

npm install mercurius-apollo-registry

Please note that this plugin requires Mercurius as a dependency.

Usage

This plugin can be used to report a given GraphQL schema to the Apollo Studio Registry.

Set up Apollo Studio

In order to use this plugin, you should already have an account with Apollo Studio as well as at least one target graph already defined. Each graph has a unique API key associated with it that will be required by this plugin at start up.

You can find more information about Apollo Studio here.

Add plugin to your fastify instance

const mercuriusApolloRegistry = require('mercurius-apollo-registry')

fastify.register(mercuriusApolloRegistry, {
  schema,
  apiKey
})

Plugin options

  • schema string (required) A stringified version of the GraphQL schema used by Mercurius.
  • apiKey string (required) API key for the specific graph you wish to reference in Apollo Studio.
  • graphVariant string (optional) The GraphQL variant to use in Apollo Studio. Defaults to current.
  • registryUrl string (optional) The registry API endpoint to use. Defaults to https://schema-reporting.api.apollographql.com/api/graphql.

Registry Protocol

A complete reference for the registry reporting protocol can be found in the Apollo GraphQL Documentation.

This plugin aims to allow integration and operability between Apollo Studio and Mercurius.

Contributing

See CONTRIBUTING.md

License

Copyright NearForm Ltd 2021. Licensed under the Apache-2.0 license.