@arcblock/graphql-playground 2.1.59 → 2.1.62
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/GraphqlPlayground.stories.js +60 -0
- package/lib/demo/basic.js +32 -0
- package/lib/demo/kitchen-sink.js +33 -0
- package/lib/demo/with-code-exporter.js +32 -0
- package/lib/demo/with-history.js +31 -0
- package/lib/demo/with-query-composer.js +30 -0
- package/package.json +4 -4
- package/src/GraphqlPlayground.stories.js +16 -0
- package/src/demo/basic.js +26 -0
- package/src/demo/kitchen-sink.js +26 -0
- package/src/demo/with-code-exporter.js +25 -0
- package/src/demo/with-history.js +25 -0
- package/src/demo/with-query-composer.js +24 -0
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "Basic", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function get() {
|
|
9
|
+
return _basic.default;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "KitchenSink", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function get() {
|
|
15
|
+
return _kitchenSink.default;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "WithCodeExporter", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function get() {
|
|
21
|
+
return _withCodeExporter.default;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(exports, "WithHistory", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function get() {
|
|
27
|
+
return _withHistory.default;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
Object.defineProperty(exports, "WithQueryComposer", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function get() {
|
|
33
|
+
return _withQueryComposer.default;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
exports.default = void 0;
|
|
37
|
+
|
|
38
|
+
var _basic = _interopRequireDefault(require("./demo/basic"));
|
|
39
|
+
|
|
40
|
+
var _withHistory = _interopRequireDefault(require("./demo/with-history"));
|
|
41
|
+
|
|
42
|
+
var _withQueryComposer = _interopRequireDefault(require("./demo/with-query-composer"));
|
|
43
|
+
|
|
44
|
+
var _withCodeExporter = _interopRequireDefault(require("./demo/with-code-exporter"));
|
|
45
|
+
|
|
46
|
+
var _kitchenSink = _interopRequireDefault(require("./demo/kitchen-sink"));
|
|
47
|
+
|
|
48
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
49
|
+
|
|
50
|
+
var _default = {
|
|
51
|
+
title: 'UX/GraphQLPlayground',
|
|
52
|
+
parameters: {
|
|
53
|
+
docs: {
|
|
54
|
+
description: {
|
|
55
|
+
component: 'A GraphQL Playground component built on top of `graphql/graphiql`'
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
exports.default = _default;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = Basic;
|
|
7
|
+
|
|
8
|
+
var _ = _interopRequireDefault(require(".."));
|
|
9
|
+
|
|
10
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
+
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
+
|
|
14
|
+
const betaQuery = "{\n getChainInfo {\n code\n info {\n network\n moniker\n }\n }\n}";
|
|
15
|
+
|
|
16
|
+
function Basic() {
|
|
17
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
18
|
+
style: {
|
|
19
|
+
minWidth: '1280px',
|
|
20
|
+
height: '40vh',
|
|
21
|
+
border: '1px solid #EEE'
|
|
22
|
+
},
|
|
23
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_.default, {
|
|
24
|
+
defaultQuery: betaQuery,
|
|
25
|
+
endpoint: "https://beta.abtnetwork.io/api/",
|
|
26
|
+
title: "Beta Chain",
|
|
27
|
+
enableQueryComposer: false,
|
|
28
|
+
enableCodeExporter: false,
|
|
29
|
+
enableHistory: false
|
|
30
|
+
})
|
|
31
|
+
});
|
|
32
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = KitchenSink;
|
|
7
|
+
|
|
8
|
+
var _ = _interopRequireDefault(require(".."));
|
|
9
|
+
|
|
10
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
+
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
+
|
|
14
|
+
const betaQuery = "{\n getChainInfo {\n code\n info {\n network\n moniker\n }\n }\n}";
|
|
15
|
+
|
|
16
|
+
function KitchenSink() {
|
|
17
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
18
|
+
style: {
|
|
19
|
+
minWidth: '1280px',
|
|
20
|
+
height: '40vh',
|
|
21
|
+
border: '1px solid #EEE',
|
|
22
|
+
marginTop: '16px'
|
|
23
|
+
},
|
|
24
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_.default, {
|
|
25
|
+
defaultQuery: betaQuery,
|
|
26
|
+
endpoint: "https://beta.abtnetwork.io/api/",
|
|
27
|
+
title: "Beta Chain",
|
|
28
|
+
enableHistory: true,
|
|
29
|
+
enableQueryComposer: true,
|
|
30
|
+
enableCodeExporter: true
|
|
31
|
+
})
|
|
32
|
+
});
|
|
33
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = WithCodeExporter;
|
|
7
|
+
|
|
8
|
+
var _ = _interopRequireDefault(require(".."));
|
|
9
|
+
|
|
10
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
+
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
+
|
|
14
|
+
const betaQuery = "{\n getChainInfo {\n code\n info {\n network\n moniker\n }\n }\n}";
|
|
15
|
+
|
|
16
|
+
function WithCodeExporter() {
|
|
17
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
18
|
+
style: {
|
|
19
|
+
minWidth: '1280px',
|
|
20
|
+
height: '40vh',
|
|
21
|
+
border: '1px solid #EEE',
|
|
22
|
+
marginTop: '16px'
|
|
23
|
+
},
|
|
24
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_.default, {
|
|
25
|
+
defaultQuery: betaQuery,
|
|
26
|
+
endpoint: "https://beta.abtnetwork.io/api/",
|
|
27
|
+
title: "Beta Chain",
|
|
28
|
+
enableQueryComposer: false,
|
|
29
|
+
enableCodeExporter: true
|
|
30
|
+
})
|
|
31
|
+
});
|
|
32
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = WithHistory;
|
|
7
|
+
|
|
8
|
+
var _ = _interopRequireDefault(require(".."));
|
|
9
|
+
|
|
10
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
+
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
+
|
|
14
|
+
const betaQuery = "{\n getChainInfo {\n code\n info {\n network\n moniker\n }\n }\n}";
|
|
15
|
+
|
|
16
|
+
function WithHistory() {
|
|
17
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
18
|
+
style: {
|
|
19
|
+
width: '1280px',
|
|
20
|
+
height: '40vh',
|
|
21
|
+
border: '1px solid #EEE'
|
|
22
|
+
},
|
|
23
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_.default, {
|
|
24
|
+
defaultQuery: betaQuery,
|
|
25
|
+
endpoint: "https://beta.abtnetwork.io/api/",
|
|
26
|
+
title: "Beta Chain",
|
|
27
|
+
enableQueryComposer: false,
|
|
28
|
+
enableHistory: true
|
|
29
|
+
})
|
|
30
|
+
});
|
|
31
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = WithQueryComposer;
|
|
7
|
+
|
|
8
|
+
var _ = _interopRequireDefault(require(".."));
|
|
9
|
+
|
|
10
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
+
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
+
|
|
14
|
+
const betaQuery = "{\n getChainInfo {\n code\n info {\n network\n moniker\n }\n }\n}";
|
|
15
|
+
|
|
16
|
+
function WithQueryComposer() {
|
|
17
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
18
|
+
style: {
|
|
19
|
+
minWidth: '1280px',
|
|
20
|
+
height: '40vh',
|
|
21
|
+
border: '1px solid #EEE'
|
|
22
|
+
},
|
|
23
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_.default, {
|
|
24
|
+
defaultQuery: betaQuery,
|
|
25
|
+
endpoint: "https://beta.abtnetwork.io/api/",
|
|
26
|
+
title: "Beta Chain",
|
|
27
|
+
enableQueryComposer: true
|
|
28
|
+
})
|
|
29
|
+
});
|
|
30
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcblock/graphql-playground",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.62",
|
|
4
4
|
"description": "A React Component to interact with GraphQL APIs",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"url": "git+https://github.com/ArcBlock/ux.git"
|
|
21
21
|
},
|
|
22
22
|
"scripts": {
|
|
23
|
-
"lint": "eslint src
|
|
23
|
+
"lint": "eslint src tests",
|
|
24
24
|
"build": "babel src --out-dir lib --copy-files",
|
|
25
25
|
"watch": "babel src --out-dir lib -w --copy-files",
|
|
26
26
|
"precommit": "CI=1 yarn test",
|
|
@@ -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.62",
|
|
37
37
|
"axios": "^0.21.2",
|
|
38
38
|
"core-js": "^3.6.4",
|
|
39
39
|
"graphiql": "^1.9.11",
|
|
@@ -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": "002cec5cff2f6f9505efabe358becd588acb2b19"
|
|
63
63
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export { default as Basic } from './demo/basic';
|
|
2
|
+
export { default as WithHistory } from './demo/with-history';
|
|
3
|
+
export { default as WithQueryComposer } from './demo/with-query-composer';
|
|
4
|
+
export { default as WithCodeExporter } from './demo/with-code-exporter';
|
|
5
|
+
export { default as KitchenSink } from './demo/kitchen-sink';
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
title: 'UX/GraphQLPlayground',
|
|
9
|
+
parameters: {
|
|
10
|
+
docs: {
|
|
11
|
+
description: {
|
|
12
|
+
component: 'A GraphQL Playground component built on top of `graphql/graphiql`',
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import GraphQLPlayground from '..';
|
|
2
|
+
|
|
3
|
+
const betaQuery = `{
|
|
4
|
+
getChainInfo {
|
|
5
|
+
code
|
|
6
|
+
info {
|
|
7
|
+
network
|
|
8
|
+
moniker
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
}`;
|
|
12
|
+
|
|
13
|
+
export default function Basic() {
|
|
14
|
+
return (
|
|
15
|
+
<div style={{ minWidth: '1280px', height: '40vh', border: '1px solid #EEE' }}>
|
|
16
|
+
<GraphQLPlayground
|
|
17
|
+
defaultQuery={betaQuery}
|
|
18
|
+
endpoint="https://beta.abtnetwork.io/api/"
|
|
19
|
+
title="Beta Chain"
|
|
20
|
+
enableQueryComposer={false}
|
|
21
|
+
enableCodeExporter={false}
|
|
22
|
+
enableHistory={false}
|
|
23
|
+
/>
|
|
24
|
+
</div>
|
|
25
|
+
);
|
|
26
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import GraphQLPlayground from '..';
|
|
2
|
+
|
|
3
|
+
const betaQuery = `{
|
|
4
|
+
getChainInfo {
|
|
5
|
+
code
|
|
6
|
+
info {
|
|
7
|
+
network
|
|
8
|
+
moniker
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
}`;
|
|
12
|
+
|
|
13
|
+
export default function KitchenSink() {
|
|
14
|
+
return (
|
|
15
|
+
<div style={{ minWidth: '1280px', height: '40vh', border: '1px solid #EEE', marginTop: '16px' }}>
|
|
16
|
+
<GraphQLPlayground
|
|
17
|
+
defaultQuery={betaQuery}
|
|
18
|
+
endpoint="https://beta.abtnetwork.io/api/"
|
|
19
|
+
title="Beta Chain"
|
|
20
|
+
enableHistory
|
|
21
|
+
enableQueryComposer
|
|
22
|
+
enableCodeExporter
|
|
23
|
+
/>
|
|
24
|
+
</div>
|
|
25
|
+
);
|
|
26
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import GraphQLPlayground from '..';
|
|
2
|
+
|
|
3
|
+
const betaQuery = `{
|
|
4
|
+
getChainInfo {
|
|
5
|
+
code
|
|
6
|
+
info {
|
|
7
|
+
network
|
|
8
|
+
moniker
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
}`;
|
|
12
|
+
|
|
13
|
+
export default function WithCodeExporter() {
|
|
14
|
+
return (
|
|
15
|
+
<div style={{ minWidth: '1280px', height: '40vh', border: '1px solid #EEE', marginTop: '16px' }}>
|
|
16
|
+
<GraphQLPlayground
|
|
17
|
+
defaultQuery={betaQuery}
|
|
18
|
+
endpoint="https://beta.abtnetwork.io/api/"
|
|
19
|
+
title="Beta Chain"
|
|
20
|
+
enableQueryComposer={false}
|
|
21
|
+
enableCodeExporter
|
|
22
|
+
/>
|
|
23
|
+
</div>
|
|
24
|
+
);
|
|
25
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import GraphQLPlayground from '..';
|
|
2
|
+
|
|
3
|
+
const betaQuery = `{
|
|
4
|
+
getChainInfo {
|
|
5
|
+
code
|
|
6
|
+
info {
|
|
7
|
+
network
|
|
8
|
+
moniker
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
}`;
|
|
12
|
+
|
|
13
|
+
export default function WithHistory() {
|
|
14
|
+
return (
|
|
15
|
+
<div style={{ width: '1280px', height: '40vh', border: '1px solid #EEE' }}>
|
|
16
|
+
<GraphQLPlayground
|
|
17
|
+
defaultQuery={betaQuery}
|
|
18
|
+
endpoint="https://beta.abtnetwork.io/api/"
|
|
19
|
+
title="Beta Chain"
|
|
20
|
+
enableQueryComposer={false}
|
|
21
|
+
enableHistory
|
|
22
|
+
/>
|
|
23
|
+
</div>
|
|
24
|
+
);
|
|
25
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import GraphQLPlayground from '..';
|
|
2
|
+
|
|
3
|
+
const betaQuery = `{
|
|
4
|
+
getChainInfo {
|
|
5
|
+
code
|
|
6
|
+
info {
|
|
7
|
+
network
|
|
8
|
+
moniker
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
}`;
|
|
12
|
+
|
|
13
|
+
export default function WithQueryComposer() {
|
|
14
|
+
return (
|
|
15
|
+
<div style={{ minWidth: '1280px', height: '40vh', border: '1px solid #EEE' }}>
|
|
16
|
+
<GraphQLPlayground
|
|
17
|
+
defaultQuery={betaQuery}
|
|
18
|
+
endpoint="https://beta.abtnetwork.io/api/"
|
|
19
|
+
title="Beta Chain"
|
|
20
|
+
enableQueryComposer
|
|
21
|
+
/>
|
|
22
|
+
</div>
|
|
23
|
+
);
|
|
24
|
+
}
|