Skip to content

Commit b947533

Browse files
committed
added env vars to playground
1 parent 8b17ab5 commit b947533

File tree

6 files changed

+38
-31
lines changed

6 files changed

+38
-31
lines changed
Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
{
22
"name": "graphql-playground-html",
3-
"version": "1.3.7-alpha.2",
4-
"homepage":
5-
"https://github.com/graphcool/graphql-playground/tree/master/packages/graphql-playground-html",
6-
"description":
7-
"GraphQL IDE for better development workflows (GraphQL Subscriptions, interactive docs & collaboration).",
3+
"version": "1.3.7-alpha.3",
4+
"homepage": "https://github.com/graphcool/graphql-playground/tree/master/packages/graphql-playground-html",
5+
"description": "GraphQL IDE for better development workflows (GraphQL Subscriptions, interactive docs & collaboration).",
86
"contributors": [
97
"Tim Suchanek <[email protected]>",
108
"Johannes Schickling <[email protected]>",
@@ -13,12 +11,19 @@
1311
"repository": "http://github.com/graphcool/graphql-playground.git",
1412
"license": "SEE LICENSE IN LICENSE",
1513
"main": "dist/index.js",
16-
"files": ["dist"],
14+
"files": [
15+
"dist"
16+
],
1717
"scripts": {
1818
"build": "tsc",
1919
"prepublishOnly": "npm run build"
2020
},
21-
"keywords": ["graphql", "graphiql", "playground", "graphcool"],
21+
"keywords": [
22+
"graphql",
23+
"graphiql",
24+
"playground",
25+
"graphcool"
26+
],
2227
"devDependencies": {
2328
"@types/node": "^8.0.47",
2429
"typescript": "^2.6.1"
@@ -28,7 +33,8 @@
2833
"definition": "dist/index.d.ts"
2934
},
3035
"dependencies": {
36+
"dotenv": "^4.0.0",
3137
"graphql-config": "^1.0.9",
32-
"graphql-config-extension-graphcool": "^0.0.1"
38+
"graphql-config-extension-graphcool": "^0.0.2"
3339
}
3440
}

packages/graphql-playground-html/src/render-playground-page.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
resolveEnvsInValues,
88
} from 'graphql-config'
99
import { patchEndpointsToConfig } from 'graphql-config-extension-graphcool'
10+
import * as dotenv from 'dotenv'
1011

1112
import getLoadingMarkup from './get-loading-markup'
1213

@@ -30,10 +31,11 @@ let configString
3031
let folderName
3132
let env
3233
async function init() {
34+
dotenv.config()
3335
try {
3436
config = getGraphQLConfig().config
3537
config = resolveEnvsInValues(config, process.env)
36-
config = await patchEndpointsToConfig(config, process.cwd())
38+
config = await patchEndpointsToConfig(config, process.cwd(), process.env)
3739
configPath = findGraphQLConfigFile(process.cwd())
3840
configString = fs.readFileSync(configPath, 'utf-8')
3941
folderName = path.basename(process.cwd())

packages/graphql-playground-html/yarn.lock

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,9 @@ graphcool-json-schema@^1.0.1-alpha.2:
133133
version "1.0.1-alpha.2"
134134
resolved "https://registry.yarnpkg.com/graphcool-json-schema/-/graphcool-json-schema-1.0.1-alpha.2.tgz#14dd7c880d9df9045b8e658896948522c89f4f49"
135135

136-
graphcool-yml@^0.0.0-alpha.3:
137-
version "0.0.0-alpha.3"
138-
resolved "https://registry.yarnpkg.com/graphcool-yml/-/graphcool-yml-0.0.0-alpha.3.tgz#0086e450dedb6d0b6137ebcb09bca60485a55ce5"
136+
graphcool-yml@^0.0.2:
137+
version "0.0.2"
138+
resolved "https://registry.yarnpkg.com/graphcool-yml/-/graphcool-yml-0.0.2.tgz#e682f413e54615028d836d0cc105b372acabc63b"
139139
dependencies:
140140
ajv "^5.5.1"
141141
bluebird "^3.5.1"
@@ -150,11 +150,11 @@ graphcool-yml@^0.0.0-alpha.3:
150150
scuid "^1.0.2"
151151
yaml-ast-parser "^0.0.40"
152152

153-
graphql-config-extension-graphcool@^0.0.1:
154-
version "0.0.1"
155-
resolved "https://registry.yarnpkg.com/graphql-config-extension-graphcool/-/graphql-config-extension-graphcool-0.0.1.tgz#fcb393a26a0fc5888db4430eceee3854a83d2c86"
153+
graphql-config-extension-graphcool@^0.0.2:
154+
version "0.0.2"
155+
resolved "https://registry.yarnpkg.com/graphql-config-extension-graphcool/-/graphql-config-extension-graphcool-0.0.2.tgz#e6c0f3e6f805ab3a4a8618d256a7acfe516ecc6f"
156156
dependencies:
157-
graphcool-yml "^0.0.0-alpha.3"
157+
graphcool-yml "^0.0.2"
158158
graphql-config "^1.1.0"
159159

160160
graphql-config@^1.0.9:

packages/graphql-playground-middleware-express/examples/graphcool/graphcool.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,5 @@ stages:
44
default: dev
55
dev: shared-eu-west-1
66

7-
secret: 'asdf'
8-
97
datamodel:
108
- datamodel.graphql

packages/graphql-playground-middleware-express/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "graphql-playground-middleware-express",
3-
"version": "1.3.7-alpha.2",
3+
"version": "1.3.7-alpha.3",
44
"homepage": "https://github.com/graphcool/graphql-playground/tree/master/packages/graphql-playground-middleware-express",
55
"description": "GraphQL IDE for better development workflows (GraphQL Subscriptions, interactive docs & collaboration).",
66
"contributors": [
@@ -32,7 +32,7 @@
3232
"typescript": "^2.6.1"
3333
},
3434
"dependencies": {
35-
"graphql-playground-html": "^1.3.7-alpha.2",
35+
"graphql-playground-html": "^1.3.7-alpha.3",
3636
"graphql-playground-middleware": "^1.2.1-beta.6"
3737
},
3838
"typings": "dist/index.d.ts",

packages/graphql-playground-middleware-express/yarn.lock

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,9 @@ graphcool-json-schema@^1.0.1-alpha.2:
139139
version "1.0.1-alpha.2"
140140
resolved "https://registry.yarnpkg.com/graphcool-json-schema/-/graphcool-json-schema-1.0.1-alpha.2.tgz#14dd7c880d9df9045b8e658896948522c89f4f49"
141141

142-
graphcool-yml@^0.0.0-alpha.3:
143-
version "0.0.0-alpha.3"
144-
resolved "https://registry.yarnpkg.com/graphcool-yml/-/graphcool-yml-0.0.0-alpha.3.tgz#0086e450dedb6d0b6137ebcb09bca60485a55ce5"
142+
graphcool-yml@^0.0.2:
143+
version "0.0.2"
144+
resolved "https://registry.yarnpkg.com/graphcool-yml/-/graphcool-yml-0.0.2.tgz#e682f413e54615028d836d0cc105b372acabc63b"
145145
dependencies:
146146
ajv "^5.5.1"
147147
bluebird "^3.5.1"
@@ -156,11 +156,11 @@ graphcool-yml@^0.0.0-alpha.3:
156156
scuid "^1.0.2"
157157
yaml-ast-parser "^0.0.40"
158158

159-
graphql-config-extension-graphcool@^0.0.1:
160-
version "0.0.1"
161-
resolved "https://registry.yarnpkg.com/graphql-config-extension-graphcool/-/graphql-config-extension-graphcool-0.0.1.tgz#fcb393a26a0fc5888db4430eceee3854a83d2c86"
159+
graphql-config-extension-graphcool@^0.0.2:
160+
version "0.0.2"
161+
resolved "https://registry.yarnpkg.com/graphql-config-extension-graphcool/-/graphql-config-extension-graphcool-0.0.2.tgz#e6c0f3e6f805ab3a4a8618d256a7acfe516ecc6f"
162162
dependencies:
163-
graphcool-yml "^0.0.0-alpha.3"
163+
graphcool-yml "^0.0.2"
164164
graphql-config "^1.1.0"
165165

166166
graphql-config@^1.0.9:
@@ -193,12 +193,13 @@ graphql-import@^0.1.5:
193193
graphql "^0.11.7"
194194
lodash "^4.17.4"
195195

196-
graphql-playground-html@^1.3.7-alpha.2:
197-
version "1.3.7-alpha.2"
198-
resolved "https://registry.yarnpkg.com/graphql-playground-html/-/graphql-playground-html-1.3.7-alpha.2.tgz#135bc5424b7284637e5bac6bec38a891ea5dc5e2"
196+
graphql-playground-html@^1.3.7-alpha.3:
197+
version "1.3.7-alpha.3"
198+
resolved "https://registry.yarnpkg.com/graphql-playground-html/-/graphql-playground-html-1.3.7-alpha.3.tgz#3b8baf325b8891ae38edcbf8d2798dd8d8464213"
199199
dependencies:
200+
dotenv "^4.0.0"
200201
graphql-config "^1.0.9"
201-
graphql-config-extension-graphcool "^0.0.1"
202+
graphql-config-extension-graphcool "^0.0.2"
202203

203204
graphql-playground-middleware@^1.2.1-beta.6:
204205
version "1.2.1-beta.6"

0 commit comments

Comments
 (0)