问题描述
如果我在本地运行npm start
-一切正常
If I run localy npm start
- everything is ok
如果我运行git subtree push --prefix server heroku-server master
-构建成功!
If I run git subtree push --prefix server heroku-server master
- Build succeeded!
当我打开https://tmdb-apollo.herokuapp.com/
-"error": "Response not successful: Received status code 400"
如果我仍然进行查询或更改-可以!魔法! (但是我没有自动完成功能,右侧的shema
侧边栏始终在旋转)
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存储库此处
Github repo here
我怀疑这与我的MongoDB
连接设置有关
I suspect it has something to do with my MongoDB
connection setup
推荐答案
距离我找到解决方案已经快三天了:需要添加introspection: true
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,
})
这篇关于“接收到的状态代码400"被表示为“接收状态代码400".阿波罗服务器部署到heroku之后的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!