“Received status code 400” after apollo-server deploy to heroku

牧云@^-^@ 提交于 2019-12-23 06:47:42

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!