问题描述
如果我运行localy npm start - 一切都很好
如果我运行git subtree push --prefix server heroku-server master - 构建成功!
我打开https://tmdb-apollo.herokuapp.com/ - "error": "Response not successful: Received status code 400"
如果我仍然进行查询或突变 - 它可以工作!魔法! (但是我没有自动完成,右侧的shema侧边栏总是在旋转)
我怀疑这与我的MongoDB连接设置有关
推荐答案
已经将近3天了,直到我找到了一个解决方案: 需要添加introspection: true
// Set up Apollo Server const server = new ApolloServer({ typeDefs, resolvers, dataSources, context, introspection: true, })
问题描述
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
推荐答案
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, })