Pet*_*ter 1 apollo graphql apollo-server
当我模拟production(aka, playground is disabled) 并转到我的根目录时,http://localhost:9000/我收到以下响应:
400 Bad Request
GET query missing
有没有办法防止这种情况或解决方法来呈现其他页面?
我是阿波罗的新手。我只使用apollo-server(没有快递)。我将不胜感激任何帮助。
使用 的默认配置apollo-server-xxx,您需要POST向/graphql端点发送请求,请求正文为 graphql 字符串。
我遇到了同样的问题,因为我发送了GET请求而不是POST.
使用playground: true:
const server = new ApolloServer({
    introspection: true,
    playground: true,
    typeDefs,
    resolvers,
})
| 归档时间: | 
 | 
| 查看次数: | 4170 次 | 
| 最近记录: |