Skip to content

Commit bc644c8

Browse files
committed
fix opening playground
1 parent e7a602f commit bc644c8

File tree

4 files changed

+9
-7
lines changed

4 files changed

+9
-7
lines changed

packages/graphql-playground-electron/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@
137137
"extract-text-webpack-plugin": "^2.0.0-beta.3",
138138
"file-loader": "^0.11.2",
139139
"fork-ts-checker-webpack-plugin": "^0.1.5",
140-
"graphql-playground": "^1.3.0-beta.2",
140+
"graphql-playground": "^1.3.0-beta.4",
141141
"happypack": "^3.1.0",
142142
"html-webpack-plugin": "^2.30.1",
143143
"identity-obj-proxy": "^3.0.0",

packages/graphql-playground-electron/src/main.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,10 @@ async function forceSend(channel: string, arg: string) {
7070
console.log('created window')
7171
await new Promise(r => {
7272
console.log('waiting for dom to be ready')
73-
window.once('ready-to-show', r)
74-
setTimeout(r, 3000)
73+
window.webContents.addListener('dom-ready', r)
7574
})
75+
await new Promise(r => setTimeout(r, 200))
76+
console.log('did finish load')
7677
}
7778
// send(channel, arg)
7879
// console.log('window')
@@ -311,6 +312,7 @@ app.on('ready', () => {
311312
app.setAsDefaultProtocolClient('graphql-playground')
312313

313314
app.on('open-url', (event, url) => {
315+
event.preventDefault()
314316
forceSend('OpenUrl', url)
315317
})
316318

packages/graphql-playground-electron/yarn.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3334,9 +3334,9 @@ [email protected]:
33343334
graphql "^0.10.1"
33353335
graphql-language-service-types "0.0.21"
33363336

3337-
graphql-playground@^1.3.0-beta.2:
3338-
version "1.3.0-beta.2"
3339-
resolved "https://registry.yarnpkg.com/graphql-playground/-/graphql-playground-1.3.0-beta.2.tgz#a6fb3f95ccf0d33d7a8cf8618626432d147d4e13"
3337+
graphql-playground@^1.3.0-beta.4:
3338+
version "1.3.0-beta.4"
3339+
resolved "https://registry.yarnpkg.com/graphql-playground/-/graphql-playground-1.3.0-beta.4.tgz#1deff93286d39aaf7fe98947949b53b71364c7df"
33403340
dependencies:
33413341
calculate-size "^1.1.1"
33423342
classnames "^2.2.5"

packages/graphql-playground/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "graphql-playground",
3-
"version": "1.3.0-beta.3",
3+
"version": "1.3.0-beta.4",
44
"main": "./lib/lib.js",
55
"typings": "./lib/lib.d.ts",
66
"description": "GraphQL IDE for better development workflows (GraphQL Subscriptions, interactive docs & collaboration).",

0 commit comments

Comments
 (0)