Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

apollo graph manager 406: Not Acceptable

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'?

like image 374
Sihoon Kim Avatar asked Sep 12 '25 10:09

Sihoon Kim


1 Answers

this error would indicate that you do not have the correct ENGINE_API_KEY loaded: https://github.com/apollographql/apollo-tooling/issues/1166

like image 137
jclyons52 Avatar answered Sep 13 '25 23:09

jclyons52