“接收到的状态代码400"被表示为“接收状态代码400".阿波罗服务器部署到heroku之后 [英] "Received status code 400" after apollo-server deploy to heroku

查看:118
本文介绍了“接收到的状态代码400"被表示为“接收状态代码400".阿波罗服务器部署到heroku之后的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我在本地运行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之后的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆