0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【備忘録】nestjs ApolloClientのPlaygroundは使うな、landingPageのPluginを使え

0
Posted at

結論

import { Module } from '@nestjs/common';
import { GraphQLModule } from '@nestjs/graphql';
import { ApolloDriver, ApolloDriverConfig } from '@nestjs/apollo';
import { SampleModule } from './sample/sample.module';
import { ApolloServerPluginLandingPageLocalDefault } from '@apollo/server/plugin/landingPage/default';

@Module({
  imports: [
    GraphQLModule.forRoot<ApolloDriverConfig>({
      driver: ApolloDriver,
      autoSchemaFile: true,
      playground: false,
      plugins: [ApolloServerPluginLandingPageLocalDefault()],
    }),
    SampleModule,
  ],
})
export class GraphqlModule {}

playgroundはfalseにして、ApolloServerPluginLandingPageLocalDefaultを使うほうが良さそう

image.png

こんなコード

@Module({
  imports: [
    GraphQLModule.forRoot<ApolloDriverConfig>({
      driver: ApolloDriver,
      autoSchemaFile: true,
      playground: true,
    }),
    SampleModule,
  ],
})
export class GraphqlModule {}

https://docs.nestjs.com/graphql/quick-start#graphql-playground
公式ドキュメントを見てもplayground: trueにすればいいよって書いてあるが...

不具合の概要

image.png

こんな感じで書いていて、サジェスト選択すると
image.png
サジェストで選択したウィンドウが残ってしまう不具合がありました。

そもそもこのPlaygroundそのものがもうすでにメンテされていなさそうなので、多分非推奨になっている

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?