简体   繁体   中英

How to disable apollo sandbox and launch playground?

I was using apollo-server and when I needed to get access to the playground I only put localhost:4000 and I got access to Playground, but now when I try to get access to playground is redirected to the sandbox, the question is about how can I disable that behaviour and launch playground instead of the sandbox.

Thanks.

This change that you're experiencing might have been caused by upgrading (maybe accidentally or automatically) from Apollo Server v2 to v3. The v3.0.0 release of Apollo Server happened 10 days ago.

Apollo Server v3 changed the default behavior of the server's landing page, but you can still configure the GraphQL Playground by following these instructions .

import { ApolloServer } from "apollo-server";
import {
  ApolloServerPluginLandingPageGraphQLPlayground
} from "apollo-server-core";

const server = new ApolloServer({
  typeDefs,
  resolvers,
  plugins: [
    ApolloServerPluginLandingPageGraphQLPlayground(),
  ],
});

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM