Skip to content

Commit

Permalink
Remove graphql-confing (graphql#874)
Browse files Browse the repository at this point in the history
  • Loading branch information
huv1k authored Nov 13, 2018
1 parent 7c655b6 commit 9cab497
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 90 deletions.
4 changes: 1 addition & 3 deletions packages/graphql-playground-html/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,5 @@
"typescript": {
"definition": "dist/index.d.ts"
},
"dependencies": {
"graphql-config": "2.2.1"
}
"dependencies": {}
}
37 changes: 17 additions & 20 deletions packages/graphql-playground-html/src/render-playground-page.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import getLoadingMarkup from './get-loading-markup'
import { GraphQLConfigData } from 'graphql-config'

export interface MiddlewareOptions {
endpoint?: string
subscriptionEndpoint?: string
workspaceName?: string
env?: any
config?: GraphQLConfigData
config?: any
settings?: ISettings
schema?: IntrospectionResult
tabs?: Tab[]
Expand Down Expand Up @@ -68,22 +67,22 @@ export interface Tab {

const loading = getLoadingMarkup()

const getCdnMarkup = ({version, cdnUrl = '//cdn.jsdelivr.net/npm'}) => `
<link rel="stylesheet" href="${cdnUrl}/graphql-playground-react${
version ? `@${version}` : ''
}/build/static/css/index.css" />
<link rel="shortcut icon" href="${cdnUrl}/graphql-playground-react${
version ? `@${version}` : ''
}/build/favicon.png" />
<script src="${cdnUrl}/graphql-playground-react${
version ? `@${version}` : ''
}/build/static/js/middleware.js"></script>
const getCdnMarkup = ({ version, cdnUrl = '//cdn.jsdelivr.net/npm' }) => `
<link rel="stylesheet" href="${cdnUrl}/graphql-playground-react${version
? `@${version}`
: ''}/build/static/css/index.css" />
<link rel="shortcut icon" href="${cdnUrl}/graphql-playground-react${version
? `@${version}`
: ''}/build/favicon.png" />
<script src="${cdnUrl}/graphql-playground-react${version
? `@${version}`
: ''}/build/static/js/middleware.js"></script>
`

export function renderPlaygroundPage(options: RenderPageOptions) {
const extendedOptions: any = {
...options,
canSaveConfig: false,
canSaveConfig: false
}
// for compatibility
if ((options as any).subscriptionsEndpoint) {
Expand All @@ -95,7 +94,7 @@ export function renderPlaygroundPage(options: RenderPageOptions) {
if (!extendedOptions.endpoint && !extendedOptions.configString) {
/* tslint:disable-next-line */
console.warn(
`WARNING: You didn't provide an endpoint and don't have a .graphqlconfig. Make sure you have at least one of them.`,
`WARNING: You didn't provide an endpoint and don't have a .graphqlconfig. Make sure you have at least one of them.`
)
}

Expand All @@ -107,11 +106,9 @@ export function renderPlaygroundPage(options: RenderPageOptions) {
<meta name="viewport" content="user-scalable=no, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, minimal-ui">
<link rel="shortcut icon" href="https://graphcool-playground.netlify.com/favicon.png">
<title>${extendedOptions.title || 'GraphQL Playground'}</title>
${
extendedOptions.env === 'react' || extendedOptions.env === 'electron'
? ''
: getCdnMarkup(extendedOptions)
}
${extendedOptions.env === 'react' || extendedOptions.env === 'electron'
? ''
: getCdnMarkup(extendedOptions)}
</head>
<body>
<style type="text/css">
Expand Down Expand Up @@ -172,7 +169,7 @@ export function renderPlaygroundPage(options: RenderPageOptions) {
GraphQLPlayground.init(root, ${JSON.stringify(
extendedOptions,
null,
2,
2
)})
})
</script>
Expand Down
67 changes: 0 additions & 67 deletions packages/graphql-playground-html/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@
version "9.4.6"
resolved "https://registry.yarnpkg.com/@types/node/-/node-9.4.6.tgz#d8176d864ee48753d053783e4e463aec86b8d82e"

argparse@^1.0.7:
version "1.0.9"
resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.9.tgz#73d83bc263f86e97f8cc4f6bae1b0e90a7d22c86"
dependencies:
sprintf-js "~1.0.2"

balanced-match@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767"
Expand All @@ -27,17 +21,6 @@ [email protected]:
version "0.0.1"
resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"

[email protected]:
version "2.2.2"
resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-2.2.2.tgz#a47ff4f7fc712daba8f6a695a11c948440d45723"
dependencies:
node-fetch "2.1.2"
whatwg-fetch "2.0.4"

esprima@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.0.tgz#4499eddcd1110e0b218bacf2fa7f7f59f55ca804"

fs.realpath@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f"
Expand All @@ -53,29 +36,6 @@ glob@^7.0.5:
once "^1.3.0"
path-is-absolute "^1.0.0"

[email protected]:
version "2.2.1"
resolved "https://registry.yarnpkg.com/graphql-config/-/graphql-config-2.2.1.tgz#5fd0ec77ac7428ca5fb2026cf131be10151a0cb2"
dependencies:
graphql-import "^0.7.1"
graphql-request "^1.5.0"
js-yaml "^3.10.0"
lodash "^4.17.4"
minimatch "^3.0.4"

graphql-import@^0.7.1:
version "0.7.1"
resolved "https://registry.yarnpkg.com/graphql-import/-/graphql-import-0.7.1.tgz#4add8d91a5f752d764b0a4a7a461fcd93136f223"
dependencies:
lodash "^4.17.4"
resolve-from "^4.0.0"

graphql-request@^1.5.0:
version "1.8.2"
resolved "https://registry.yarnpkg.com/graphql-request/-/graphql-request-1.8.2.tgz#398d10ae15c585676741bde3fc01d5ca948f8fbe"
dependencies:
cross-fetch "2.2.2"

inflight@^1.0.4:
version "1.0.6"
resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9"
Expand All @@ -87,27 +47,12 @@ inherits@2:
version "2.0.3"
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de"

js-yaml@^3.10.0:
version "3.10.0"
resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.10.0.tgz#2e78441646bd4682e963f22b6e92823c309c62dc"
dependencies:
argparse "^1.0.7"
esprima "^4.0.0"

lodash@^4.17.4:
version "4.17.4"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae"

minimatch@^3.0.4:
version "3.0.4"
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083"
dependencies:
brace-expansion "^1.1.7"

[email protected]:
version "2.1.2"
resolved "http://registry.npmjs.org/node-fetch/-/node-fetch-2.1.2.tgz#ab884e8e7e57e38a944753cec706f788d1768bb5"

once@^1.3.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1"
Expand All @@ -118,28 +63,16 @@ path-is-absolute@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f"

resolve-from@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6"

[email protected]:
version "2.6.2"
resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.2.tgz#2ed8150d24a16ea8651e6d6ef0f47c4158ce7a36"
dependencies:
glob "^7.0.5"

sprintf-js@~1.0.2:
version "1.0.3"
resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c"

[email protected]:
version "2.6.2"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.6.2.tgz#3c5b6fd7f6de0914269027f03c0946758f7673a4"

[email protected]:
version "2.0.4"
resolved "http://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-2.0.4.tgz#dde6a5df315f9d39991aa17621853d720b85566f"

wrappy@1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"

0 comments on commit 9cab497

Please sign in to comment.