【问题标题】:How to disable apollo sandbox and launch playground?如何禁用 apollo 沙盒并启动 Playground?
【发布时间】:2021-09-25 22:23:06
【问题描述】:

我使用的是 apollo-server,当我需要访问操场时,我只输入了 localhost:4000 并且我可以访问操场,但是现在当我尝试访问操场时被重定向到沙箱,问题是关于如何禁用该行为并启动游乐场而不是沙箱。

谢谢。

【问题讨论】:

    标签: node.js apollo-server graphql-playground


    【解决方案1】:

    您遇到的这种变化可能是由于从 Apollo Server v2 升级(可能是意外或自动)到 v3 造成的。 The v3.0.0 release of Apollo Server 发生在 10 天前。

    Apollo Server v3 更改了服务器登陆页面的默认行为,但您仍然可以通过关注 these instructions 来配置 GraphQL Playground。

    import { ApolloServer } from "apollo-server";
    import {
      ApolloServerPluginLandingPageGraphQLPlayground
    } from "apollo-server-core";
    
    const server = new ApolloServer({
      typeDefs,
      resolvers,
      plugins: [
        ApolloServerPluginLandingPageGraphQLPlayground(),
      ],
    });
    

    【讨论】:

      猜你喜欢
      • 2015-01-09
      • 1970-01-01
      • 2014-01-02
      • 2016-01-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-09-30
      相关资源
      最近更新 更多