In 2.0.0-beta.0 apollo-engine works as documented in the blog post but after upgrading to 2.0.0-beta.1 it stops working. I don't know if this is because something changed or if something is broken now.
I am running into the same issue: apollo-engine doesn't work on 2.0.0-beta.1 but works on 2.0.0-beta.0.
I found the problem by looking at the apollo-server-core latest source: the blog post and glitch example are based on 2.0.0-beta.0 but the API has changed. It looks like the the engine flag needs to be passed on the listen() call instead of doing it on the ApolloServer instantiation.
Here is how I got it working:
const server = new ApolloServer({ typeDefs, resolvers });
server
.listen({ engine: true })
.then(({ url }) => {
console.log(`馃殌 Server ready at ${url}`)
})
@jbaxleyiii @peggyrayzis it would be great if you could update the blog post and glitch example to avoid confusion. I am sure I am not the only one who relied on these sources of truth to enable apollo-engine.
Let me know if it's also in the new docs and I will be happy to help out with a PR.
By the way, awesome work on the new apollo-server! I am in 鉂わ笍 with everything you do!
Faced the same issue. I'm also running into a problem that somehow the ENGINE_API_KEY doesn't get picked up. Getting this error when using the code above;
ERRO[0000] Error loading configuration. error="parse config from environment variable failed: invalid character 'u' looking for beginning of value"
Thank you @loicplaire for the solution! In the newest beta, we've changed the option from engine to engineProxy. You can check it out in the same glitch
@leovanhaaren How are you passing the environment variable the node process? Can you add a console.log(process.env.ENGINE_API_KEY)?
const server = new ApolloServer({ typeDefs, resolvers });
server
.listen({ engineProxy: true })
.then(({ url }) => {
console.log(`馃殌 Server ready at ${url}`)
})
@evans thanks, adding engineProxy fixed it. Thought it was something else.
Most helpful comment
I found the problem by looking at the
apollo-server-corelatest source: the blog post and glitch example are based on2.0.0-beta.0but the API has changed. It looks like the theengineflag needs to be passed on thelisten()call instead of doing it on theApolloServerinstantiation.Here is how I got it working:
@jbaxleyiii @peggyrayzis it would be great if you could update the blog post and glitch example to avoid confusion. I am sure I am not the only one who relied on these sources of truth to enable
apollo-engine.Let me know if it's also in the new docs and I will be happy to help out with a PR.
By the way, awesome work on the new
apollo-server! I am in 鉂わ笍 with everything you do!