From 6c67f148e3802a19d45141fb18c8f7523beb0f23 Mon Sep 17 00:00:00 2001 From: filippbudko Date: Mon, 15 Oct 2018 10:27:50 +0100 Subject: [PATCH] renderPlaygroundPage - cdnUrl config option (#845) * renderPlaygroundPage - cdnUrl config option Allow the cdn url to be passed in to renderPlaygroundPage as an option. This is to support graphql-playground being used offline by tools such as Apollo Server. See https://github.com/apollographql/apollo-server/issues/1421 * don't insert @ in cdn url if no version given If version is not passed then don't append @ to the cdn url. This is to aid serving from localhost from a folder with no given version number. See #845 --- .../src/render-playground-page.ts | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/packages/graphql-playground-html/src/render-playground-page.ts b/packages/graphql-playground-html/src/render-playground-page.ts index 9437a17..553ddfa 100644 --- a/packages/graphql-playground-html/src/render-playground-page.ts +++ b/packages/graphql-playground-html/src/render-playground-page.ts @@ -54,6 +54,7 @@ export interface IntrospectionResult { export interface RenderPageOptions extends MiddlewareOptions { version: string + cdnUrl?: string env?: any } @@ -67,15 +68,15 @@ export interface Tab { const loading = getLoadingMarkup() -const getCdnMarkup = options => ` - - - `