Răsfoiți Sursa

fix(core): Disable graphql playground according to apiOptions setting

Fixes #2246
Michael Bromley 2 ani în urmă
părinte
comite
b9a0200017
1 a modificat fișierele cu 1 adăugiri și 1 ștergeri
  1. 1 1
      packages/core/src/api/config/configure-graphql-module.ts

+ 1 - 1
packages/core/src/api/config/configure-graphql-module.ts

@@ -116,7 +116,7 @@ async function createGraphQLOptions(
             new IdCodecPlugin(idCodecService),
             new IdCodecPlugin(idCodecService),
             new TranslateErrorsPlugin(i18nService),
             new TranslateErrorsPlugin(i18nService),
             new AssetInterceptorPlugin(configService),
             new AssetInterceptorPlugin(configService),
-            ApolloServerPluginLandingPageGraphQLPlayground(),
+            ...(options.playground ? [ApolloServerPluginLandingPageGraphQLPlayground()] : []),
             ...configService.apiOptions.apolloServerPlugins,
             ...configService.apiOptions.apolloServerPlugins,
         ],
         ],
         validationRules: options.validationRules,
         validationRules: options.validationRules,