禁用Playground时,缺少Apollo服务器返回的GET查询 [英] apollo-server returning GET query missing when playground is disabled

查看:96
本文介绍了禁用Playground时,缺少Apollo服务器返回的GET查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我模拟 production (又名 playground被禁用)时,我进入根目录 http://localhost:9000/我收到以下答复:

When I emulate production (aka, playground is disabled) and I go to my root, http://localhost:9000/ I receive the following response:

400 Bad Request

GET query missing

是否有一种方法可以防止这种情况或解决方法来渲染其他页面?

Is there a way to prevent this or a workaround to render other page?

我对阿波罗很陌生.我只使用 apollo服务器(无快递).我将不胜感激.

I'm new with apollo. I'm using just apollo-server (no express). I will appreciate any help.

推荐答案

使用操场:真:

const server = new ApolloServer({
    introspection: true,
    playground: true,
    typeDefs,
    resolvers,
})

这篇关于禁用Playground时,缺少Apollo服务器返回的GET查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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