问题
If I run localy npm start - everything is ok
If I run git subtree push --prefix server heroku-server master - Build succeeded!
When I open https://tmdb-apollo.herokuapp.com/ - "error": "Response not successful: Received status code 400"
If I still do a query or mutation - it works! magic! (but I do not have autocomplete and shema sidebar on the right is always spinning)
Github repo here
I suspect it has something to do with my MongoDB connection setup
回答1:
It's been nearly 3 days till I found a solution:
Need to add introspection: true
// Set up Apollo Server
const server = new ApolloServer({
typeDefs,
resolvers,
dataSources,
context,
introspection: true,
})
来源:https://stackoverflow.com/questions/53606573/received-status-code-400-after-apollo-server-deploy-to-heroku