Apollo-Server
Installation
npm i @graphql-hive/client
We recommend installing Hive Client package as a direct dependency of your project, because it includes a runtime to send usage reports and schemas to Hive registry.
The @graphql-hive/client
package exports a
Apollo-Server plugin (opens in a new tab), that can be used
directly.
Integration Guide
Publishing Schemas
Please use the Hive CLI to publish your GraphQL schema. Follow the CI/CD instructions for automating the process.
Usage Reporting
You can send usage reporting to Hive registry by using the usage
section of the configuration:
import { ApolloServer } from 'apollo-server'
import { hiveApollo } from '@graphql-hive/client'
const server = new ApolloServer({
typeDefs,
resolvers,
plugins: [
hiveApollo({
enabled: true,
token: 'YOUR-TOKEN',
reporting: { ... },
usage: true, // add this one
})
]
})