menu

Apollo

A community of developers, designers and others who love Apollo and GraphQL. 🚀

Channels
# All channels
view-forward
# General
view-forward
# Apollo Angular
view-forward
# Announcements
view-forward
# Apollo Android
view-forward
# Apollo Client
view-forward
# Apollo iOS
view-forward
# Apollo Link
view-forward
# Apollo Link Rest
view-forward
# Local State
view-forward
# Apollo Studio
view-forward
# Apollo Server
view-forward
# Apollo Tooling
view-forward
# Contributing
view-forward
# Docs
view-forward
# Events
view-forward
# GraphQL Tools
view-forward
# Jobs
view-forward
# Random
view-forward
# React Apollo
view-forward
# Showcase
view-forward
# Subscriptions
view-forward
# Testing
view-forward
# Vue Apollo
view-forward
Team

How do I specify the variant of managed schema?

February 5, 2020 at 7:22am

How do I specify the variant of managed schema?

February 5, 2020 at 7:22am
Regardless of what I do, I get the warning No graph variant provided. Defaulting to 'current'.
One option was new ApolloGateway({ engine: { graphVariant: 'staging' }}) Another was new ApolloGateway({ engine: { variant: 'staging' }}) I've also tried placing this under the ApolloServer constructor.
The lack of documentation around this is driving me insane 🙃

February 5, 2020 at 3:06pm
If anyone is looking into this, this appears to be the right configuration for running managed mode in production environments, and unmanaged mode in development.
const apolloServer = new ApolloServer({
gateway,
subscriptions: false,
playground: {
settings: config.get('playground.settings'),
},
engine: {
apiKey: config.get('engine.apiKey'),
schemaTag: config.get('appEnv'),
},
and
const options = {
debug: config.get('debug'),
}
// In managed mode, you cannot pass options.serviceList as undefined/null, because Apollo checks for existence of key
if (config.get('nodeEnv') === 'development') {
options.serviceList = [...]
}
const gateway = new ApolloGateway(options)
Edited
like-fill
1
  • reply
  • like