Skip to content

Commit 6c038af

Browse files
committed
add extension
1 parent 68534ea commit 6c038af

File tree

3 files changed

+24
-9
lines changed

3 files changed

+24
-9
lines changed

packages/graphql-playground-electron/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@
9595
"graphcool-ui": "^0.0.13",
9696
"graphql-config": "^1.1.2",
9797
"graphql-config-extension-graphcool": "1.0.4",
98-
"graphql-config-extension-prisma": "0.0.1",
98+
"graphql-config-extension-prisma": "0.0.3",
9999
"graphql-playground-react": "1.3.22",
100100
"js-yaml": "^3.10.0",
101101
"lodash.merge": "^4.6.0",

packages/graphql-playground-electron/src/renderer/components/App.tsx

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import * as os from 'os'
2020
import * as yaml from 'js-yaml'
2121
import * as findUp from 'find-up'
2222
import { patchEndpointsToConfigData } from 'graphql-config-extension-graphcool'
23+
import { patchEndpointsToConfigData as patchPrismaEndpointsToConfigData } from 'graphql-config-extension-prisma'
2324
// import { PermissionSession } from 'graphql-playground/lib/types'
2425

2526
const { dialog } = remote
@@ -119,7 +120,15 @@ cd ${folderPath}; graphql playground`)
119120
}
120121

121122
const configDir = path.dirname(configPath)
122-
const config = await patchEndpointsToConfigData(
123+
let config = await patchEndpointsToConfigData(
124+
resolveEnvsInValues(
125+
getGraphQLConfig(path.dirname(configPath)).config,
126+
process.env,
127+
),
128+
configDir,
129+
process.env,
130+
)
131+
config = await patchPrismaEndpointsToConfigData(
123132
resolveEnvsInValues(
124133
getGraphQLConfig(path.dirname(configPath)).config,
125134
process.env,
@@ -259,6 +268,11 @@ cd ${folderPath}; graphql playground`)
259268
input.cwd,
260269
input.env,
261270
)
271+
config = await patchPrismaEndpointsToConfigData(
272+
resolvedConfig,
273+
input.cwd,
274+
input.env,
275+
)
262276

263277
if (!this.configContainsEndpoints(config)) {
264278
const graphcoolNote = configString.includes('graphcool')

packages/graphql-playground-electron/yarn.lock

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3513,12 +3513,12 @@ [email protected]:
35133513
graphcool-yml "0.4.8"
35143514
graphql-config "^1.1.4"
35153515

3516-
3517-
version "0.0.1"
3518-
resolved "https://registry.yarnpkg.com/graphql-config-extension-prisma/-/graphql-config-extension-prisma-0.0.1.tgz#ab02d0aa80bc12883e4c898b04e0db5e73ed1936"
3516+
3517+
version "0.0.3"
3518+
resolved "https://registry.yarnpkg.com/graphql-config-extension-prisma/-/graphql-config-extension-prisma-0.0.3.tgz#2fea0a34ef128e1763cb3ebfa6becd99549fe1ef"
35193519
dependencies:
35203520
graphql-config "^1.1.4"
3521-
prisma-yml "0.0.2"
3521+
prisma-yml "0.0.4"
35223522

35233523
35243524
version "1.1.4"
@@ -6150,12 +6150,13 @@ prisma-json-schema@^0.0.1:
61506150
version "0.0.1"
61516151
resolved "https://registry.yarnpkg.com/prisma-json-schema/-/prisma-json-schema-0.0.1.tgz#0802e156a293faefdf21e5e41beb8d3681f45cb1"
61526152

6153-
6154-
version "0.0.2"
6155-
resolved "https://registry.yarnpkg.com/prisma-yml/-/prisma-yml-0.0.2.tgz#7f86e5fcb7dfe4a8cbf104a8b36ea9de69a9c0d3"
6153+
6154+
version "0.0.4"
6155+
resolved "https://registry.yarnpkg.com/prisma-yml/-/prisma-yml-0.0.4.tgz#66b54f5056f087ff548719bb62e5251ca49fe4b1"
61566156
dependencies:
61576157
ajv "^5.5.1"
61586158
bluebird "^3.5.1"
6159+
chalk "^2.3.0"
61596160
debug "^3.1.0"
61606161
dotenv "^4.0.0"
61616162
fs-extra "^4.0.3"

0 commit comments

Comments
 (0)