You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Merged from sdl-tabs https://github.com/Novvum/graphql-playground.git
* Added and integrated setting's key for 'schema.disableComments'
* Merged changes from disableComments branch
* Fixes and style changes matching @kuldar's design specs. Details on #897 comments
* Still not able to cmd+save settings. Might be a deeper issue. However, save button saves disabled comments
* Added tabWidth prop to SideTab.tsx to provide specific widths for different tabs.
* Fix for Tab Spacing in collapsed state
Fix for additional line-breaks after each item
- ⚙ GraphQL Config support with multiple Projects & Endpoints
22
+
- 🚥 Apollo Tracing support
23
23
24
24
## FAQ
25
25
26
26
### How is this different from [GraphiQL](https://github.com/graphql/graphiql)?
27
27
28
28
GraphQL Playground uses components of GraphiQL under the hood but is meant as a more powerful GraphQL IDE enabling better (local) development workflows. Compared to GraphiQL, the GraphQL Playground ships with the following additional features:
29
29
30
-
* Interactive, multi-column schema documentation
31
-
* Automatic schema reloading
32
-
* Support for GraphQL Subscriptions
33
-
* Query history
34
-
* Configuration of HTTP headers
35
-
* Tabs
30
+
- Interactive, multi-column schema documentation
31
+
- Automatic schema reloading
32
+
- Support for GraphQL Subscriptions
33
+
- Query history
34
+
- Configuration of HTTP headers
35
+
- Tabs
36
36
37
37
See the following question for more additonal features.
38
38
39
39
### What's the difference between the desktop app and the web version?
40
40
41
41
The desktop app is the same as the web version but includes these additional features:
42
42
43
-
* Partial support for [graphql-config](https://github.com/prismagraphql/graphql-config) enabling features like multi-environment setups (no support for sending HTTP headers).
44
-
* Double click on `*.graphql` files.
43
+
- Partial support for [graphql-config](https://github.com/prismagraphql/graphql-config) enabling features like multi-environment setups (no support for sending HTTP headers).
44
+
- Double click on `*.graphql` files.
45
45
46
46
### How does GraphQL Bin work?
47
47
@@ -77,43 +77,44 @@ These are the settings currently available:
77
77
78
78
The React component `<Playground />` and all middlewares expose the following options:
79
79
80
-
*`props` (Middlewares & React Component)
81
-
*`endpoint`[`string`](optional) - the GraphQL endpoint url.
82
-
*`subscriptionEndpoint`[`string`](optional) - the GraphQL subscriptions endpoint url.
83
-
*`workspaceName`[`string`](optional) - in case you provide a GraphQL Config, you can name your workspace here
84
-
*`config`[`string`](optional) - the JSON of a GraphQL Config. See an example [here](https://github.com/prismagraphql/graphql-playground/blob/master/packages/graphql-playground-react/src/localDevIndex.tsx#L47)
85
-
*`settings`[`ISettings`](optional) - Editor settings in json format as [described here](https://github.com/prismagraphql/graphql-playground#settings)
80
+
-`props` (Middlewares & React Component)
81
+
-`endpoint`[`string`](optional) - the GraphQL endpoint url.
82
+
-`subscriptionEndpoint`[`string`](optional) - the GraphQL subscriptions endpoint url.
83
+
-`workspaceName`[`string`](optional) - in case you provide a GraphQL Config, you can name your workspace here
84
+
-`config`[`string`](optional) - the JSON of a GraphQL Config. See an example [here](https://github.com/prismagraphql/graphql-playground/blob/master/packages/graphql-playground-react/src/localDevIndex.tsx#L47)
85
+
-`settings`[`ISettings`](optional) - Editor settings in json format as [described here](https://github.com/prismagraphql/graphql-playground#settings)
86
86
87
87
```ts
88
88
interfaceISettings {
89
-
'general.betaUpdates':boolean
90
-
'editor.theme':Theme
91
-
'editor.reuseHeaders':boolean
92
-
'tracing.hideTracingResponse':boolean
93
-
'editor.fontSize':number
94
-
'editor.fontFamily':string
95
-
'request.credentials':string
89
+
'general.betaUpdates':boolean
90
+
'editor.theme':Theme
91
+
'editor.reuseHeaders':boolean
92
+
'tracing.hideTracingResponse':boolean
93
+
'editor.fontSize':number
94
+
'editor.fontFamily':string
95
+
'request.credentials':string
96
+
'schema.disableComments':boolean
96
97
}
97
98
```
98
99
99
-
*`schema`[`IntrospectionResult`](optional) - The result of an introspection query (an object of this form: `{__schema: {...}}`) The playground automatically fetches the schema from the endpoint. This is only needed when you want to override the schema.
100
-
*`tabs`[`Tab[]`](optional) - An array of tabs to inject. **Note: When using this feature, tabs will be resetted each time the page is reloaded**
100
+
-`schema`[`IntrospectionResult`](optional) - The result of an introspection query (an object of this form: `{__schema: {...}}`) The playground automatically fetches the schema from the endpoint. This is only needed when you want to override the schema.
101
+
-`tabs`[`Tab[]`](optional) - An array of tabs to inject. **Note: When using this feature, tabs will be resetted each time the page is reloaded**
101
102
102
103
```ts
103
104
interfaceTab {
104
-
endpoint:string
105
-
query:string
106
-
name?:string
107
-
variables?:string
108
-
responses?:string[]
109
-
headers?: { [key:string]:string }
105
+
endpoint:string
106
+
query:string
107
+
name?:string
108
+
variables?:string
109
+
responses?:string[]
110
+
headers?: { [key:string]:string }
110
111
}
111
112
```
112
113
113
114
In addition to this, the React app provides some more properties:
114
115
115
-
*`props` (React Component)
116
-
*`createApolloLink`[`(session: Session) => ApolloLink`] - this is the equivalent to the `fetcher` of GraphiQL. For each query that is being executed, this function will be called
116
+
-`props` (React Component)
117
+
-`createApolloLink`[`(session: Session) => ApolloLink`] - this is the equivalent to the `fetcher` of GraphiQL. For each query that is being executed, this function will be called
117
118
118
119
`createApolloLink` is only available in the React Component and not the middlewares, because the content must be serializable as it is being printed into a HTML template.
119
120
@@ -145,7 +146,10 @@ The GraphQL Playground requires **React 16**.
We have a full example for each of the frameworks below:
182
186
183
-
***Express:** See [packages/graphql-playground-middleware-express/examples/basic](https://github.com/prismagraphql/graphql-playground/tree/master/packages/graphql-playground-middleware-express/examples/basic)
187
+
-**Express:** See [packages/graphql-playground-middleware-express/examples/basic](https://github.com/prismagraphql/graphql-playground/tree/master/packages/graphql-playground-middleware-express/examples/basic)
184
188
185
-
***Hapi:** See [packages/graphql-playground-middleware-hapi](https://github.com/prismagraphql/graphql-playground/tree/master/packages/graphql-playground-middleware-hapi)
189
+
-**Hapi:** See [packages/graphql-playground-middleware-hapi](https://github.com/prismagraphql/graphql-playground/tree/master/packages/graphql-playground-middleware-hapi)
186
190
187
-
***Koa:** See [packages/graphql-playground-middleware-koa](https://github.com/prismagraphql/graphql-playground/tree/master/packages/graphql-playground-middleware-koa)
191
+
-**Koa:** See [packages/graphql-playground-middleware-koa](https://github.com/prismagraphql/graphql-playground/tree/master/packages/graphql-playground-middleware-koa)
188
192
189
-
***Lambda (as serverless handler):** See [serverless-graphql-apollo](https://github.com/serverless/serverless-graphql-apollo) or a quick example below.
193
+
-**Lambda (as serverless handler):** See [serverless-graphql-apollo](https://github.com/serverless/serverless-graphql-apollo) or a quick example below.
190
194
191
195
### As serverless handler
192
196
@@ -206,18 +210,18 @@ import lambdaPlayground from 'graphql-playground-middleware-lambda'
[localhost:3000/localDev.html?endpoint=https://api.graph.cool/simple/v1/swapi](http://localhost:3000/localDev.html?endpoint=https://api.graph.cool/simple/v1/swapi) for local development!
254
258
255
259
## Custom Theme
260
+
256
261
From `[email protected]` on you can provide a `codeTheme` property to the React Component to customize your color theme.
257
262
These are the available options:
258
-
```ts
259
263
264
+
```ts
260
265
exportinterfaceEditorColours {
261
-
property:string
262
-
comment:string
263
-
punctuation:string
264
-
keyword:string
265
-
def:string
266
-
qualifier:string
267
-
attribute:string
268
-
number:string
269
-
string:string
270
-
builtin:string
271
-
string2:string
272
-
variable:string
273
-
meta:string
274
-
atom:string
275
-
ws:string
276
-
selection:string
277
-
cursorColor:string
278
-
editorBackground:string
279
-
resultBackground:string
280
-
leftDrawerBackground:string
281
-
rightDrawerBackground:string
266
+
property:string
267
+
comment:string
268
+
punctuation:string
269
+
keyword:string
270
+
def:string
271
+
qualifier:string
272
+
attribute:string
273
+
number:string
274
+
string:string
275
+
builtin:string
276
+
string2:string
277
+
variable:string
278
+
meta:string
279
+
atom:string
280
+
ws:string
281
+
selection:string
282
+
cursorColor:string
283
+
editorBackground:string
284
+
resultBackground:string
285
+
leftDrawerBackground:string
286
+
rightDrawerBackground:string
282
287
}
283
288
```
284
289
@@ -290,13 +295,13 @@ This is repository is a "mono repo" and contains multiple packages using [Yarn w
290
295
291
296
In the folder `packages` you'll find the following packages:
292
297
293
-
*`graphql-playground-electron`: Cross-platform electron app which uses `graphql-playground-react`
294
-
*`graphql-playground-html`: Simple HTML page rendering a version of `graphql-playground-react` hosted on JSDeliver
295
-
*`graphql-playground-middleware-express`: Express middleware using `graphql-playground-html`
296
-
*`graphql-playground-middleware-hapi`: Hapi middleware using `graphql-playground-html`
297
-
*`graphql-playground-middleware-koa`: Koa middleware using `graphql-playground-html`
298
-
*`graphql-playground-middleware-lambda`: AWS Lambda middleware using `graphql-playground-html`
299
-
*`graphql-playground-react`: Core of GraphQL Playground built with ReactJS
298
+
-`graphql-playground-electron`: Cross-platform electron app which uses `graphql-playground-react`
299
+
-`graphql-playground-html`: Simple HTML page rendering a version of `graphql-playground-react` hosted on JSDeliver
300
+
-`graphql-playground-middleware-express`: Express middleware using `graphql-playground-html`
301
+
-`graphql-playground-middleware-hapi`: Hapi middleware using `graphql-playground-html`
302
+
-`graphql-playground-middleware-koa`: Koa middleware using `graphql-playground-html`
303
+
-`graphql-playground-middleware-lambda`: AWS Lambda middleware using `graphql-playground-html`
304
+
-`graphql-playground-react`: Core of GraphQL Playground built with ReactJS
0 commit comments