@arcblock/graphql-playground 2.1.18 → 2.1.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.js +55 -48
- package/package.json +3 -3
- package/src/index.js +40 -69
- package/src/util.js +2 -2
package/lib/index.js
CHANGED
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = GraphQLPlayground;
|
|
7
7
|
|
|
8
|
-
var _react =
|
|
8
|
+
var _react = require("react");
|
|
9
9
|
|
|
10
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
11
|
|
|
@@ -37,14 +37,12 @@ var _Util = require("@arcblock/ux/lib/Util");
|
|
|
37
37
|
|
|
38
38
|
var _util = require("./util");
|
|
39
39
|
|
|
40
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
41
|
+
|
|
40
42
|
const _excluded = ["endpoint", "title", "enableCodeExporter", "enableQueryComposer", "enableHistory", "extraCodeSnippets"];
|
|
41
43
|
|
|
42
44
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
43
45
|
|
|
44
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
45
|
-
|
|
46
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
47
|
-
|
|
48
46
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
49
47
|
|
|
50
48
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
@@ -85,7 +83,8 @@ function GraphQLPlayground(props) {
|
|
|
85
83
|
} else {
|
|
86
84
|
persistQuery(query);
|
|
87
85
|
}
|
|
88
|
-
}
|
|
86
|
+
} // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
87
|
+
|
|
89
88
|
}, []);
|
|
90
89
|
|
|
91
90
|
const onInspect = (cm, mousePos) => {
|
|
@@ -214,7 +213,7 @@ function GraphQLPlayground(props) {
|
|
|
214
213
|
'Shift-Alt-LeftClick': onInspect
|
|
215
214
|
}));
|
|
216
215
|
setSchema((0, _graphql.buildClientSchema)(result.data));
|
|
217
|
-
});
|
|
216
|
+
}); // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
218
217
|
}, [graphiql.current]);
|
|
219
218
|
|
|
220
219
|
const {
|
|
@@ -228,47 +227,55 @@ function GraphQLPlayground(props) {
|
|
|
228
227
|
rest = _objectWithoutProperties(newProps, _excluded);
|
|
229
228
|
|
|
230
229
|
const snippets = [...extraCodeSnippets, ..._snippets.default];
|
|
231
|
-
return /*#__PURE__*/
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
230
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(Container, _objectSpread(_objectSpread({}, rest), {}, {
|
|
231
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactLoadScript.default, {
|
|
232
|
+
url: "//cdn.jsdelivr.net/npm/@absinthe/socket-graphiql@0.2.1/compat/umd/index.js"
|
|
233
|
+
}), enableQueryComposer && /*#__PURE__*/(0, _jsxRuntime.jsx)(_graphiqlExplorer.default, {
|
|
234
|
+
schema: schema,
|
|
235
|
+
query: query,
|
|
236
|
+
onEdit: onEditQuery,
|
|
237
|
+
onRunOperation: operationName => graphiql.current.handleRunQuery(operationName),
|
|
238
|
+
explorerIsOpen: queryComposerIsOpen,
|
|
239
|
+
onToggleExplorer: onToggleExplorer,
|
|
240
|
+
className: "graphiql-explorer"
|
|
241
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_graphiql.default, {
|
|
242
|
+
ref: graphiql,
|
|
243
|
+
fetcher: fetcher,
|
|
244
|
+
schema: schema,
|
|
245
|
+
query: query,
|
|
246
|
+
onEditQuery: onEditQuery,
|
|
247
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_graphiql.default.Logo, {
|
|
248
|
+
children: title
|
|
249
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_graphiql.default.Toolbar, {
|
|
250
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_graphiql.default.Button, {
|
|
251
|
+
onClick: () => graphiql.current.handlePrettifyQuery(),
|
|
252
|
+
label: "Prettify",
|
|
253
|
+
title: "Prettify Query (Shift-Ctrl-P)"
|
|
254
|
+
}), enableHistory && /*#__PURE__*/(0, _jsxRuntime.jsx)(_graphiql.default.Button, {
|
|
255
|
+
onClick: () => graphiql.current.handleToggleHistory(),
|
|
256
|
+
label: "History",
|
|
257
|
+
title: "Show History"
|
|
258
|
+
}), enableQueryComposer && /*#__PURE__*/(0, _jsxRuntime.jsx)(_graphiql.default.Button, {
|
|
259
|
+
onClick: onToggleExplorer,
|
|
260
|
+
label: "Query Composer",
|
|
261
|
+
title: "Toggle Query Composer"
|
|
262
|
+
}), enableCodeExporter && /*#__PURE__*/(0, _jsxRuntime.jsx)(_graphiql.default.Button, {
|
|
263
|
+
onClick: onToggleCodeExporter,
|
|
264
|
+
label: "Code Exporter",
|
|
265
|
+
title: "Toggle Code Exporter"
|
|
266
|
+
})]
|
|
267
|
+
})]
|
|
268
|
+
}), enableCodeExporter && codeExporterIsOpen && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
269
|
+
className: "graphiql-container graphiql-exporter-container",
|
|
270
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_graphiqlCodeExporter.default, {
|
|
271
|
+
hideCodeExporter: onToggleCodeExporter,
|
|
272
|
+
snippets: snippets,
|
|
273
|
+
serverUrl: endpoint,
|
|
274
|
+
query: query,
|
|
275
|
+
codeMirrorTheme: "neo"
|
|
276
|
+
})
|
|
277
|
+
})]
|
|
278
|
+
}));
|
|
272
279
|
}
|
|
273
280
|
|
|
274
281
|
GraphQLPlayground.propTypes = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcblock/graphql-playground",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.19",
|
|
4
4
|
"description": "A React Component to interact with GraphQL APIs",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"url": "https://github.com/ArcBlock/ux/issues"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@arcblock/ux": "^2.1.
|
|
36
|
+
"@arcblock/ux": "^2.1.19",
|
|
37
37
|
"axios": "^0.21.2",
|
|
38
38
|
"core-js": "^3.6.4",
|
|
39
39
|
"graphiql": "^0.13.2",
|
|
@@ -59,5 +59,5 @@
|
|
|
59
59
|
"eslint-plugin-react-hooks": "^4.2.0",
|
|
60
60
|
"jest": "^24.1.0"
|
|
61
61
|
},
|
|
62
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "7dd94cbff3bef095f0701de5779ecd9cc8d82b8f"
|
|
63
63
|
}
|
package/src/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* eslint-disable indent */
|
|
2
2
|
/* eslint-disable no-nested-ternary */
|
|
3
3
|
/* eslint-disable no-undef */
|
|
4
|
-
import
|
|
4
|
+
import { useEffect, useState, useRef } from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import styled from 'styled-components';
|
|
7
7
|
import axios from 'axios';
|
|
@@ -37,7 +37,7 @@ export default function GraphQLPlayground(props) {
|
|
|
37
37
|
const [queryComposerIsOpen, setComposerOpen] = useState(newProps.enableQueryComposer);
|
|
38
38
|
const [codeExporterIsOpen, setExporterOpen] = useState(false);
|
|
39
39
|
|
|
40
|
-
const persistQuery = newQuery => {
|
|
40
|
+
const persistQuery = (newQuery) => {
|
|
41
41
|
const { pathname, search } = history.location;
|
|
42
42
|
const params = parseQuery(search);
|
|
43
43
|
params.query = newQuery;
|
|
@@ -54,6 +54,7 @@ export default function GraphQLPlayground(props) {
|
|
|
54
54
|
persistQuery(query);
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
57
58
|
}, []);
|
|
58
59
|
|
|
59
60
|
const onInspect = (cm, mousePos) => {
|
|
@@ -75,7 +76,7 @@ export default function GraphQLPlayground(props) {
|
|
|
75
76
|
|
|
76
77
|
const position = relevantMousePos;
|
|
77
78
|
|
|
78
|
-
const def = parsedQuery.definitions.find(definition => {
|
|
79
|
+
const def = parsedQuery.definitions.find((definition) => {
|
|
79
80
|
if (!definition.loc) {
|
|
80
81
|
// eslint-disable-next-line no-console
|
|
81
82
|
console.log('Missing location information for definition');
|
|
@@ -93,11 +94,7 @@ export default function GraphQLPlayground(props) {
|
|
|
93
94
|
}
|
|
94
95
|
|
|
95
96
|
const operationKind =
|
|
96
|
-
def.kind === 'OperationDefinition'
|
|
97
|
-
? def.operation
|
|
98
|
-
: def.kind === 'FragmentDefinition'
|
|
99
|
-
? 'fragment'
|
|
100
|
-
: 'unknown';
|
|
97
|
+
def.kind === 'OperationDefinition' ? def.operation : def.kind === 'FragmentDefinition' ? 'fragment' : 'unknown';
|
|
101
98
|
|
|
102
99
|
const operationName =
|
|
103
100
|
def.kind === 'OperationDefinition' && !!def.name
|
|
@@ -114,7 +111,7 @@ export default function GraphQLPlayground(props) {
|
|
|
114
111
|
}
|
|
115
112
|
};
|
|
116
113
|
|
|
117
|
-
const onEditQuery = newQuery => {
|
|
114
|
+
const onEditQuery = (newQuery) => {
|
|
118
115
|
if (newQuery !== query && newProps.persistentQuery) {
|
|
119
116
|
persistQuery(newQuery);
|
|
120
117
|
}
|
|
@@ -145,11 +142,9 @@ export default function GraphQLPlayground(props) {
|
|
|
145
142
|
);
|
|
146
143
|
};
|
|
147
144
|
|
|
148
|
-
const httpFetcher = async params => {
|
|
145
|
+
const httpFetcher = async (params) => {
|
|
149
146
|
const extraHeaders =
|
|
150
|
-
typeof newProps.extraHeaders === 'function'
|
|
151
|
-
? newProps.extraHeaders()
|
|
152
|
-
: newProps.extraHeaders || {};
|
|
147
|
+
typeof newProps.extraHeaders === 'function' ? newProps.extraHeaders() : newProps.extraHeaders || {};
|
|
153
148
|
|
|
154
149
|
const res = await axios({
|
|
155
150
|
method: 'post',
|
|
@@ -166,7 +161,7 @@ export default function GraphQLPlayground(props) {
|
|
|
166
161
|
return res.data;
|
|
167
162
|
};
|
|
168
163
|
|
|
169
|
-
const fetcher = params => {
|
|
164
|
+
const fetcher = (params) => {
|
|
170
165
|
if (params.query.indexOf('subscription') >= 0) {
|
|
171
166
|
ensureSubscriptionClient();
|
|
172
167
|
|
|
@@ -182,7 +177,7 @@ export default function GraphQLPlayground(props) {
|
|
|
182
177
|
useEffect(() => {
|
|
183
178
|
httpFetcher({
|
|
184
179
|
query: getIntrospectionQuery(),
|
|
185
|
-
}).then(result => {
|
|
180
|
+
}).then((result) => {
|
|
186
181
|
if (!graphiql.current) {
|
|
187
182
|
return;
|
|
188
183
|
}
|
|
@@ -195,17 +190,11 @@ export default function GraphQLPlayground(props) {
|
|
|
195
190
|
|
|
196
191
|
setSchema(buildClientSchema(result.data));
|
|
197
192
|
});
|
|
193
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
198
194
|
}, [graphiql.current]);
|
|
199
195
|
|
|
200
|
-
const {
|
|
201
|
-
|
|
202
|
-
title,
|
|
203
|
-
enableCodeExporter,
|
|
204
|
-
enableQueryComposer,
|
|
205
|
-
enableHistory,
|
|
206
|
-
extraCodeSnippets,
|
|
207
|
-
...rest
|
|
208
|
-
} = newProps;
|
|
196
|
+
const { endpoint, title, enableCodeExporter, enableQueryComposer, enableHistory, extraCodeSnippets, ...rest } =
|
|
197
|
+
newProps;
|
|
209
198
|
const snippets = [...extraCodeSnippets, ...CodeExporterSnippets];
|
|
210
199
|
|
|
211
200
|
return (
|
|
@@ -216,18 +205,13 @@ export default function GraphQLPlayground(props) {
|
|
|
216
205
|
schema={schema}
|
|
217
206
|
query={query}
|
|
218
207
|
onEdit={onEditQuery}
|
|
219
|
-
onRunOperation={operationName => graphiql.current.handleRunQuery(operationName)}
|
|
208
|
+
onRunOperation={(operationName) => graphiql.current.handleRunQuery(operationName)}
|
|
220
209
|
explorerIsOpen={queryComposerIsOpen}
|
|
221
210
|
onToggleExplorer={onToggleExplorer}
|
|
222
211
|
className="graphiql-explorer"
|
|
223
212
|
/>
|
|
224
213
|
)}
|
|
225
|
-
<GraphiQL
|
|
226
|
-
ref={graphiql}
|
|
227
|
-
fetcher={fetcher}
|
|
228
|
-
schema={schema}
|
|
229
|
-
query={query}
|
|
230
|
-
onEditQuery={onEditQuery}>
|
|
214
|
+
<GraphiQL ref={graphiql} fetcher={fetcher} schema={schema} query={query} onEditQuery={onEditQuery}>
|
|
231
215
|
<GraphiQL.Logo>{title}</GraphiQL.Logo>
|
|
232
216
|
<GraphiQL.Toolbar>
|
|
233
217
|
<GraphiQL.Button
|
|
@@ -243,18 +227,10 @@ export default function GraphQLPlayground(props) {
|
|
|
243
227
|
/>
|
|
244
228
|
)}
|
|
245
229
|
{enableQueryComposer && (
|
|
246
|
-
<GraphiQL.Button
|
|
247
|
-
onClick={onToggleExplorer}
|
|
248
|
-
label="Query Composer"
|
|
249
|
-
title="Toggle Query Composer"
|
|
250
|
-
/>
|
|
230
|
+
<GraphiQL.Button onClick={onToggleExplorer} label="Query Composer" title="Toggle Query Composer" />
|
|
251
231
|
)}
|
|
252
232
|
{enableCodeExporter && (
|
|
253
|
-
<GraphiQL.Button
|
|
254
|
-
onClick={onToggleCodeExporter}
|
|
255
|
-
label="Code Exporter"
|
|
256
|
-
title="Toggle Code Exporter"
|
|
257
|
-
/>
|
|
233
|
+
<GraphiQL.Button onClick={onToggleCodeExporter} label="Code Exporter" title="Toggle Code Exporter" />
|
|
258
234
|
)}
|
|
259
235
|
</GraphiQL.Toolbar>
|
|
260
236
|
</GraphiQL>
|
|
@@ -304,15 +280,14 @@ const Container = styled.div`
|
|
|
304
280
|
height: 100%;
|
|
305
281
|
position: relative;
|
|
306
282
|
|
|
307
|
-
@media (max-width: ${props => props.theme.breakpoints.values.md}px) {
|
|
283
|
+
@media (max-width: ${(props) => props.theme.breakpoints.values.md}px) {
|
|
308
284
|
margin-top: 30px;
|
|
309
285
|
}
|
|
310
286
|
|
|
311
287
|
> .historyPaneWrap {
|
|
312
288
|
z-index: 8 !important;
|
|
313
289
|
width: 320px !important;
|
|
314
|
-
box-shadow: 5px 16px 10px 0
|
|
315
|
-
rgba(0, 0, 0, ${props => (props.theme.mode === 'light' ? 0.05 : 0.5)});
|
|
290
|
+
box-shadow: 5px 16px 10px 0 rgba(0, 0, 0, ${(props) => (props.theme.mode === 'light' ? 0.05 : 0.5)});
|
|
316
291
|
overflow-y: scroll;
|
|
317
292
|
}
|
|
318
293
|
|
|
@@ -334,7 +309,7 @@ const Container = styled.div`
|
|
|
334
309
|
font-size: 14px;
|
|
335
310
|
font-weight: 900;
|
|
336
311
|
letter-spacing: 2px;
|
|
337
|
-
color: ${props => props.theme.typography.color.gray};
|
|
312
|
+
color: ${(props) => props.theme.typography.color.gray};
|
|
338
313
|
text-transform: uppercase;
|
|
339
314
|
text-align: left !important;
|
|
340
315
|
}
|
|
@@ -342,19 +317,19 @@ const Container = styled.div`
|
|
|
342
317
|
.doc-explorer-contents,
|
|
343
318
|
.history-contents {
|
|
344
319
|
top: 45px !important;
|
|
345
|
-
background-color: ${props => props.theme.palette.background.default} !important;
|
|
320
|
+
background-color: ${(props) => props.theme.palette.background.default} !important;
|
|
346
321
|
border-top: 1px solid #e3e3e3 !important;
|
|
347
322
|
}
|
|
348
323
|
|
|
349
324
|
.history-contents {
|
|
350
|
-
color: ${props => props.theme.typography.color.main};
|
|
325
|
+
color: ${(props) => props.theme.typography.color.main};
|
|
351
326
|
p {
|
|
352
327
|
border-bottom: 1px solid #e3e3e3;
|
|
353
328
|
}
|
|
354
329
|
}
|
|
355
330
|
|
|
356
331
|
.docExplorerHide {
|
|
357
|
-
color: ${props => props.theme.typography.color.main};
|
|
332
|
+
color: ${(props) => props.theme.typography.color.main};
|
|
358
333
|
padding: 0;
|
|
359
334
|
cursor: pointer;
|
|
360
335
|
margin: -7px -8px -6px -12px;
|
|
@@ -368,7 +343,7 @@ const Container = styled.div`
|
|
|
368
343
|
|
|
369
344
|
.graphiql-container {
|
|
370
345
|
.title {
|
|
371
|
-
color: ${props => props.theme.typography.color.main};
|
|
346
|
+
color: ${(props) => props.theme.typography.color.main};
|
|
372
347
|
}
|
|
373
348
|
|
|
374
349
|
.topBar {
|
|
@@ -378,14 +353,14 @@ const Container = styled.div`
|
|
|
378
353
|
}
|
|
379
354
|
|
|
380
355
|
.docExplorerShow {
|
|
381
|
-
background: ${props => props.theme.palette.background.default};
|
|
356
|
+
background: ${(props) => props.theme.palette.background.default};
|
|
382
357
|
border: none;
|
|
383
358
|
font-size: 14px;
|
|
384
|
-
color: ${props => props.theme.typography.color.main};
|
|
359
|
+
color: ${(props) => props.theme.typography.color.main};
|
|
385
360
|
text-transform: uppercase;
|
|
386
361
|
|
|
387
362
|
&::before {
|
|
388
|
-
border-color: ${props => props.theme.typography.color.gray};
|
|
363
|
+
border-color: ${(props) => props.theme.typography.color.gray};
|
|
389
364
|
}
|
|
390
365
|
}
|
|
391
366
|
|
|
@@ -394,22 +369,20 @@ const Container = styled.div`
|
|
|
394
369
|
height: 100%;
|
|
395
370
|
top: 0;
|
|
396
371
|
right: 0;
|
|
397
|
-
background-color: ${props => props.theme.palette.background.default};
|
|
398
|
-
box-shadow: -5px 16px 10px 0
|
|
399
|
-
rgba(0, 0, 0, ${props => (props.theme.mode === 'light' ? 0.05 : 0.5)});
|
|
372
|
+
background-color: ${(props) => props.theme.palette.background.default};
|
|
373
|
+
box-shadow: -5px 16px 10px 0 rgba(0, 0, 0, ${(props) => (props.theme.mode === 'light' ? 0.05 : 0.5)});
|
|
400
374
|
z-index: 3;
|
|
401
375
|
}
|
|
402
376
|
|
|
403
377
|
.historyPaneWrap {
|
|
404
378
|
width: 320px !important;
|
|
405
|
-
background-color: ${props => props.theme.palette.background.default};
|
|
406
|
-
box-shadow: 5px 16px 10px 0
|
|
407
|
-
rgba(0, 0, 0, ${props => (props.theme.mode === 'light' ? 0.05 : 0.5)});
|
|
379
|
+
background-color: ${(props) => props.theme.palette.background.default};
|
|
380
|
+
box-shadow: 5px 16px 10px 0 rgba(0, 0, 0, ${(props) => (props.theme.mode === 'light' ? 0.05 : 0.5)});
|
|
408
381
|
}
|
|
409
382
|
|
|
410
383
|
.docExplorerWrap {
|
|
411
384
|
.doc-explorer {
|
|
412
|
-
background-color: ${props => props.theme.palette.background.default};
|
|
385
|
+
background-color: ${(props) => props.theme.palette.background.default};
|
|
413
386
|
}
|
|
414
387
|
.doc-explorer-contents {
|
|
415
388
|
padding: 32px;
|
|
@@ -423,7 +396,7 @@ const Container = styled.div`
|
|
|
423
396
|
input {
|
|
424
397
|
height: 30px;
|
|
425
398
|
border-radius: 15px;
|
|
426
|
-
border: solid 1px ${props => props.theme.typography.color.main};
|
|
399
|
+
border: solid 1px ${(props) => props.theme.typography.color.main};
|
|
427
400
|
padding: 6px 24px 8px 30px;
|
|
428
401
|
}
|
|
429
402
|
|
|
@@ -437,14 +410,14 @@ const Container = styled.div`
|
|
|
437
410
|
}
|
|
438
411
|
|
|
439
412
|
.variable-editor-title {
|
|
440
|
-
background: ${props => props.theme.palette.background.default};
|
|
413
|
+
background: ${(props) => props.theme.palette.background.default};
|
|
441
414
|
border: none;
|
|
442
415
|
height: 40px;
|
|
443
416
|
padding-left: 20px;
|
|
444
417
|
|
|
445
418
|
&::before {
|
|
446
|
-
border-left: 2px solid ${props => props.theme.typography.color.gray};
|
|
447
|
-
border-top: 2px solid ${props => props.theme.typography.color.gray};
|
|
419
|
+
border-left: 2px solid ${(props) => props.theme.typography.color.gray};
|
|
420
|
+
border-top: 2px solid ${(props) => props.theme.typography.color.gray};
|
|
448
421
|
content: '';
|
|
449
422
|
display: inline-block;
|
|
450
423
|
height: 9px;
|
|
@@ -462,8 +435,7 @@ const Container = styled.div`
|
|
|
462
435
|
opacity: 0.5;
|
|
463
436
|
}
|
|
464
437
|
.CodeMirror-gutter.CodeMirror-foldgutter {
|
|
465
|
-
box-shadow: 5px 16px 10px 0
|
|
466
|
-
rgba(0, 0, 0, ${props => (props.theme.mode === 'light' ? 0.05 : 0.5)});
|
|
438
|
+
box-shadow: 5px 16px 10px 0 rgba(0, 0, 0, ${(props) => (props.theme.mode === 'light' ? 0.05 : 0.5)});
|
|
467
439
|
}
|
|
468
440
|
}
|
|
469
441
|
|
|
@@ -471,7 +443,7 @@ const Container = styled.div`
|
|
|
471
443
|
.CodeMirror-gutters,
|
|
472
444
|
.CodeMirror-linenumber,
|
|
473
445
|
.CodeMirror-foldgutter {
|
|
474
|
-
background: ${props => props.theme.palette.background.default};
|
|
446
|
+
background: ${(props) => props.theme.palette.background.default};
|
|
475
447
|
}
|
|
476
448
|
|
|
477
449
|
.variable-editor {
|
|
@@ -492,9 +464,8 @@ const Container = styled.div`
|
|
|
492
464
|
height: 100%;
|
|
493
465
|
top: 0;
|
|
494
466
|
right: 0;
|
|
495
|
-
background-color: ${props => props.theme.palette.background.default};
|
|
496
|
-
box-shadow: -5px 16px 10px 0
|
|
497
|
-
rgba(0, 0, 0, ${props => (props.theme.mode === 'light' ? 0.05 : 0.5)});
|
|
467
|
+
background-color: ${(props) => props.theme.palette.background.default};
|
|
468
|
+
box-shadow: -5px 16px 10px 0 rgba(0, 0, 0, ${(props) => (props.theme.mode === 'light' ? 0.05 : 0.5)});
|
|
498
469
|
z-index: 3;
|
|
499
470
|
|
|
500
471
|
.history-contents {
|
package/src/util.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { parse } from 'graphql';
|
|
2
2
|
|
|
3
|
-
const hasSubscriptionOperation = graphQlParams => {
|
|
3
|
+
const hasSubscriptionOperation = (graphQlParams) => {
|
|
4
4
|
const queryDoc = parse(graphQlParams.query);
|
|
5
5
|
|
|
6
6
|
for (const definition of queryDoc.definitions) {
|
|
@@ -18,7 +18,7 @@ const hasSubscriptionOperation = graphQlParams => {
|
|
|
18
18
|
export const graphQLFetcher = (subscriptionsClient, fallbackFetcher) => {
|
|
19
19
|
let activeSubscriptionId = null;
|
|
20
20
|
|
|
21
|
-
return params => {
|
|
21
|
+
return (params) => {
|
|
22
22
|
if (subscriptionsClient && activeSubscriptionId !== null) {
|
|
23
23
|
subscriptionsClient.unsubscribe(activeSubscriptionId);
|
|
24
24
|
}
|