I am trying to use apollo graph manager, but keep getting this error, when i try to publish my graph to apollo graph manager from my local terminal.
apollo service:push --endpoint=http://localhost:3050/graphql --key="service:salading_test"
✔ Loading Apollo Project
✔ Loading Apollo Project
✖ Uploading service to Apollo Graph Manager
→ 406: Not Acceptable
Error: 406: Not Acceptable
This is what I got from apollo graph manager
ENGINE_API_KEY=service:salading_test:<key>
I copied it and added it to my .env file and restarted my server. In my server.js, I also tried with the following settings:
const { ApolloServer } = require('apollo-server-express');
const express = require('express');
const app = express();
const apolloInstance = new ApolloServer({
schema,
playground: true,
introspection: true,
engine: { //added
apiKey: process.env.ENGINE_API_KEY
}
});
apolloInstance.applyMiddleware({ app, cors: false });
app.listen(process.env.PORT, () => console.log(`Server running on port: ${process.env.PORT}`));
Now the tutorial in apollo docs uses 'apollo-server'
instead of 'apollo-server-express'
. But that shouldnt be a problem, since 'apollo-server'
is used inside 'apollo-server-express'
?
this error would indicate that you do not have the correct ENGINE_API_KEY loaded: https://github.com/apollographql/apollo-tooling/issues/1166
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With