Skip to content

Commit 25e8486

Browse files
committed
fix theme injection
1 parent 7cd1432 commit 25e8486

File tree

6 files changed

+35
-9
lines changed

6 files changed

+35
-9
lines changed

packages/graphql-playground-electron/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@
9898
"graphql-config-extension-graphcool": "1.0.8",
9999
"graphql-config-extension-prisma": "^0.0.12",
100100
"graphql-playground-html": "^1.5.6",
101-
"graphql-playground-react": "1.7.0-beta.1",
101+
"graphql-playground-react": "1.7.0-beta.2",
102102
"immutable": "4.0.0-rc.9",
103103
"js-yaml": "^3.11.0",
104104
"lodash.merge": "^4.6.1",

packages/graphql-playground-electron/yarn.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3778,9 +3778,9 @@ graphql-playground-html@^1.5.6:
37783778
dependencies:
37793779
graphql-config "2.0.0"
37803780

3781-
3782-
version "1.7.0-beta.1"
3783-
resolved "https://registry.yarnpkg.com/graphql-playground-react/-/graphql-playground-react-1.7.0-beta.1.tgz#992260c6f957989bc99fc43b2ebcc43800ec323d"
3781+
3782+
version "1.7.0-beta.2"
3783+
resolved "https://registry.yarnpkg.com/graphql-playground-react/-/graphql-playground-react-1.7.0-beta.2.tgz#158399b7075ed8d7c801e085527c31845dc396ee"
37843784
dependencies:
37853785
apollo-link "^1.0.7"
37863786
apollo-link-http "^1.3.2"

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

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ export interface MiddlewareOptions {
1010
settings?: ISettings
1111
schema?: IntrospectionResult
1212
tabs?: Tab[]
13+
codeTheme?: EditorColours
1314
}
1415

1516
export type Theme = 'dark' | 'light'
@@ -23,6 +24,30 @@ export interface ISettings {
2324
'request.credentials': string
2425
}
2526

27+
export interface EditorColours {
28+
property: string
29+
comment: string
30+
punctuation: string
31+
keyword: string
32+
def: string
33+
qualifier: string
34+
attribute: string
35+
number: string
36+
string: string
37+
builtin: string
38+
string2: string
39+
variable: string
40+
meta: string
41+
atom: string
42+
ws: string
43+
selection: string
44+
cursorColor: string
45+
editorBackground: string
46+
resultBackground: string
47+
leftDrawerBackground: string
48+
rightDrawerBackground: string
49+
}
50+
2651
export interface IntrospectionResult {
2752
__schema: any
2853
}

packages/graphql-playground-react/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-react",
3-
"version": "1.7.0-beta.2",
3+
"version": "1.7.0",
44
"main": "./lib/lib.js",
55
"typings": "./lib/lib.d.ts",
66
"description": "GraphQL IDE for better development workflows (GraphQL Subscriptions, interactive docs & collaboration).",

packages/graphql-playground-react/release.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
set -e
44

5-
npm publish
5+
#npm publish
66

77
curl -X POST \
88
http://purge.jsdelivr.net/ \

packages/graphql-playground-react/src/components/PlaygroundWrapper.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -336,9 +336,10 @@ class PlaygroundWrapper extends React.Component<
336336
...styledTheme,
337337
mode: theme,
338338
colours: theme === 'dark' ? darkColours : lightColours,
339-
editorColours:
340-
this.props.codeTheme ||
341-
(theme === 'dark' ? darkEditorColours : lightEditorColours),
339+
editorColours: {
340+
...(theme === 'dark' ? darkEditorColours : lightEditorColours),
341+
...this.props.codeTheme,
342+
},
342343
settings: this.props.settings,
343344
}}
344345
>

0 commit comments

Comments
 (0)