@webiny/app-graphql-playground 6.0.0-beta.0 β 6.0.0-rc.1
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/README.md +10 -0
- package/index.d.ts +1 -1
- package/index.js +36 -32
- package/index.js.map +1 -1
- package/package.json +13 -24
- package/plugins/Playground.d.ts +1 -1
- package/plugins/Playground.js +54 -63
- package/plugins/Playground.js.map +1 -1
- package/plugins/Playground.styles.d.ts +2 -3
- package/plugins/Playground.styles.js +10 -17
- package/plugins/Playground.styles.js.map +1 -1
- package/plugins/constants.d.ts +2 -0
- package/plugins/constants.js +4 -0
- package/plugins/constants.js.map +1 -0
- package/plugins/index.d.ts +1 -1
- package/plugins/index.js +7 -15
- package/plugins/index.js.map +1 -1
- package/plugins/settings.js +2 -8
- package/plugins/settings.js.map +1 -1
- package/routes.d.ts +4 -0
- package/routes.js +9 -0
- package/routes.js.map +1 -0
- package/types.d.ts +4 -5
- package/types.js +1 -5
- package/types.js.map +1 -1
package/README.md
CHANGED
|
@@ -1 +1,11 @@
|
|
|
1
1
|
# @webiny/app-graphql-playground
|
|
2
|
+
|
|
3
|
+
> [!NOTE]
|
|
4
|
+
> This package is part of the [Webiny](https://www.webiny.com) monorepo.
|
|
5
|
+
> Itβs **included in every Webiny project by default** and is not meant to be used as a standalone package.
|
|
6
|
+
|
|
7
|
+
π **Documentation:** [https://www.webiny.com/docs](https://www.webiny.com/docs)
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
_This README file is automatically generated during the publish process._
|
package/index.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -1,35 +1,39 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
name: "
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
1
|
+
import React, { memo } from "react";
|
|
2
|
+
import { plugins } from "@webiny/plugins";
|
|
3
|
+
import { useRouter, AdminConfig, AdminLayout } from "@webiny/app-admin";
|
|
4
|
+
import { ReactComponent as ApiPlaygroundIcon } from "@webiny/icons/swap_horiz.svg";
|
|
5
|
+
import Playground from "./plugins/Playground.js";
|
|
6
|
+
import playgroundPlugins from "./plugins/index.js";
|
|
7
|
+
import { Routes } from "./routes.js";
|
|
8
|
+
const {
|
|
9
|
+
Route,
|
|
10
|
+
Menu
|
|
11
|
+
} = AdminConfig;
|
|
12
|
+
const GraphQLPlaygroundExtension = ({
|
|
13
|
+
createApolloClient
|
|
14
|
+
}) => {
|
|
15
|
+
const router = useRouter();
|
|
16
|
+
plugins.register(playgroundPlugins);
|
|
17
|
+
return /*#__PURE__*/React.createElement(AdminConfig, null, /*#__PURE__*/React.createElement(Menu.Support, {
|
|
18
|
+
pin: "start",
|
|
19
|
+
name: "api-playground",
|
|
20
|
+
element: /*#__PURE__*/React.createElement(Menu.Support.Link, {
|
|
21
|
+
text: "API Playground",
|
|
22
|
+
icon: /*#__PURE__*/React.createElement(Menu.Support.Link.Icon, {
|
|
23
|
+
label: "API Playground",
|
|
24
|
+
element: /*#__PURE__*/React.createElement(ApiPlaygroundIcon, null)
|
|
25
|
+
}),
|
|
26
|
+
to: router.getLink(Routes.ApiPlayground)
|
|
27
|
+
})
|
|
28
|
+
}), /*#__PURE__*/React.createElement(Route, {
|
|
29
|
+
route: Routes.ApiPlayground,
|
|
30
|
+
element: /*#__PURE__*/React.createElement(AdminLayout, {
|
|
31
|
+
title: "API Playground"
|
|
32
|
+
}, /*#__PURE__*/React.createElement(Playground, {
|
|
33
|
+
createApolloClient: createApolloClient
|
|
34
|
+
}))
|
|
35
|
+
}));
|
|
32
36
|
};
|
|
33
|
-
|
|
37
|
+
export const GraphQLPlayground = /*#__PURE__*/memo(GraphQLPlaygroundExtension);
|
|
34
38
|
|
|
35
39
|
//# sourceMappingURL=index.js.map
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["React","memo","plugins","useRouter","AdminConfig","AdminLayout","ReactComponent","ApiPlaygroundIcon","Playground","playgroundPlugins","Routes","Route","Menu","GraphQLPlaygroundExtension","createApolloClient","router","register","createElement","Support","pin","name","element","Link","text","icon","Icon","label","to","getLink","ApiPlayground","route","title","GraphQLPlayground"],"sources":["index.tsx"],"sourcesContent":["import React, { memo } from \"react\";\nimport type { ApolloClient } from \"apollo-client\";\nimport { plugins } from \"@webiny/plugins\";\nimport { useRouter, AdminConfig, AdminLayout } from \"@webiny/app-admin\";\nimport { ReactComponent as ApiPlaygroundIcon } from \"@webiny/icons/swap_horiz.svg\";\nimport Playground from \"./plugins/Playground.js\";\nimport playgroundPlugins from \"./plugins/index.js\";\nimport { Routes } from \"~/routes.js\";\n\nconst { Route, Menu } = AdminConfig;\n\ninterface CreateApolloClientParams {\n uri: string;\n}\n\ninterface GraphQLPlaygroundProps {\n createApolloClient(params: CreateApolloClientParams): ApolloClient<any>;\n}\n\nconst GraphQLPlaygroundExtension = ({ createApolloClient }: GraphQLPlaygroundProps) => {\n const router = useRouter();\n plugins.register(playgroundPlugins);\n\n return (\n <AdminConfig>\n <Menu.Support\n pin={\"start\"}\n name={\"api-playground\"}\n element={\n <Menu.Support.Link\n text={\"API Playground\"}\n icon={\n <Menu.Support.Link.Icon\n label=\"API Playground\"\n element={<ApiPlaygroundIcon />}\n />\n }\n to={router.getLink(Routes.ApiPlayground)}\n />\n }\n />\n\n <Route\n route={Routes.ApiPlayground}\n element={\n <AdminLayout title={\"API Playground\"}>\n <Playground createApolloClient={createApolloClient} />\n </AdminLayout>\n }\n />\n </AdminConfig>\n );\n};\n\nexport const GraphQLPlayground = memo(GraphQLPlaygroundExtension);\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,IAAI,QAAQ,OAAO;AAEnC,SAASC,OAAO,QAAQ,iBAAiB;AACzC,SAASC,SAAS,EAAEC,WAAW,EAAEC,WAAW,QAAQ,mBAAmB;AACvE,SAASC,cAAc,IAAIC,iBAAiB,QAAQ,8BAA8B;AAClF,OAAOC,UAAU;AACjB,OAAOC,iBAAiB;AACxB,SAASC,MAAM;AAEf,MAAM;EAAEC,KAAK;EAAEC;AAAK,CAAC,GAAGR,WAAW;AAUnC,MAAMS,0BAA0B,GAAGA,CAAC;EAAEC;AAA2C,CAAC,KAAK;EACnF,MAAMC,MAAM,GAAGZ,SAAS,CAAC,CAAC;EAC1BD,OAAO,CAACc,QAAQ,CAACP,iBAAiB,CAAC;EAEnC,oBACIT,KAAA,CAAAiB,aAAA,CAACb,WAAW,qBACRJ,KAAA,CAAAiB,aAAA,CAACL,IAAI,CAACM,OAAO;IACTC,GAAG,EAAE,OAAQ;IACbC,IAAI,EAAE,gBAAiB;IACvBC,OAAO,eACHrB,KAAA,CAAAiB,aAAA,CAACL,IAAI,CAACM,OAAO,CAACI,IAAI;MACdC,IAAI,EAAE,gBAAiB;MACvBC,IAAI,eACAxB,KAAA,CAAAiB,aAAA,CAACL,IAAI,CAACM,OAAO,CAACI,IAAI,CAACG,IAAI;QACnBC,KAAK,EAAC,gBAAgB;QACtBL,OAAO,eAAErB,KAAA,CAAAiB,aAAA,CAACV,iBAAiB,MAAE;MAAE,CAClC,CACJ;MACDoB,EAAE,EAAEZ,MAAM,CAACa,OAAO,CAAClB,MAAM,CAACmB,aAAa;IAAE,CAC5C;EACJ,CACJ,CAAC,eAEF7B,KAAA,CAAAiB,aAAA,CAACN,KAAK;IACFmB,KAAK,EAAEpB,MAAM,CAACmB,aAAc;IAC5BR,OAAO,eACHrB,KAAA,CAAAiB,aAAA,CAACZ,WAAW;MAAC0B,KAAK,EAAE;IAAiB,gBACjC/B,KAAA,CAAAiB,aAAA,CAACT,UAAU;MAACM,kBAAkB,EAAEA;IAAmB,CAAE,CAC5C;EAChB,CACJ,CACQ,CAAC;AAEtB,CAAC;AAED,OAAO,MAAMkB,iBAAiB,gBAAG/B,IAAI,CAACY,0BAA0B,CAAC","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/app-graphql-playground",
|
|
3
|
-
"version": "6.0.0-
|
|
3
|
+
"version": "6.0.0-rc.1",
|
|
4
|
+
"type": "module",
|
|
4
5
|
"main": "index.js",
|
|
5
6
|
"repository": {
|
|
6
7
|
"type": "git",
|
|
@@ -11,44 +12,32 @@
|
|
|
11
12
|
"dependencies": {
|
|
12
13
|
"@emotion/react": "11.10.8",
|
|
13
14
|
"@emotion/styled": "11.10.6",
|
|
14
|
-
"@webiny/app": "6.0.0-
|
|
15
|
-
"@webiny/app-admin": "6.0.0-
|
|
16
|
-
"@webiny/
|
|
17
|
-
"@webiny/
|
|
18
|
-
"@webiny/
|
|
19
|
-
"@webiny/ui": "6.0.0-beta.0",
|
|
15
|
+
"@webiny/app": "6.0.0-rc.1",
|
|
16
|
+
"@webiny/app-admin": "6.0.0-rc.1",
|
|
17
|
+
"@webiny/icons": "6.0.0-rc.1",
|
|
18
|
+
"@webiny/plugins": "6.0.0-rc.1",
|
|
19
|
+
"@webiny/ui": "6.0.0-rc.1",
|
|
20
20
|
"apollo-cache": "1.3.5",
|
|
21
21
|
"apollo-client": "2.6.10",
|
|
22
22
|
"apollo-link": "1.2.14",
|
|
23
23
|
"apollo-link-context": "1.0.20",
|
|
24
24
|
"apollo-utilities": "1.3.4",
|
|
25
|
-
"graphql": "
|
|
25
|
+
"graphql": "16.12.0",
|
|
26
26
|
"load-script": "1.0.0",
|
|
27
27
|
"prop-types": "15.8.1",
|
|
28
28
|
"react": "18.2.0",
|
|
29
29
|
"react-dom": "18.2.0"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@babel
|
|
33
|
-
"@
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"@babel/preset-react": "7.24.1",
|
|
37
|
-
"@babel/preset-typescript": "7.24.1",
|
|
38
|
-
"@emotion/babel-plugin": "11.11.0",
|
|
39
|
-
"@webiny/cli": "6.0.0-beta.0",
|
|
40
|
-
"@webiny/project-utils": "6.0.0-beta.0",
|
|
41
|
-
"rimraf": "5.0.5",
|
|
42
|
-
"typescript": "4.7.4"
|
|
32
|
+
"@emotion/babel-plugin": "11.13.5",
|
|
33
|
+
"@webiny/build-tools": "6.0.0-rc.1",
|
|
34
|
+
"rimraf": "6.1.3",
|
|
35
|
+
"typescript": "5.9.3"
|
|
43
36
|
},
|
|
44
37
|
"publishConfig": {
|
|
45
38
|
"access": "public",
|
|
46
39
|
"directory": "dist"
|
|
47
40
|
},
|
|
48
|
-
"scripts": {
|
|
49
|
-
"build": "yarn webiny run build",
|
|
50
|
-
"watch": "yarn webiny run watch"
|
|
51
|
-
},
|
|
52
41
|
"adio": {
|
|
53
42
|
"ignore": {
|
|
54
43
|
"src": [
|
|
@@ -59,5 +48,5 @@
|
|
|
59
48
|
]
|
|
60
49
|
}
|
|
61
50
|
},
|
|
62
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "36d702721ff9ed39fb21d6f5fe7922a2a8716e63"
|
|
63
52
|
}
|
package/plugins/Playground.d.ts
CHANGED
package/plugins/Playground.js
CHANGED
|
@@ -1,70 +1,61 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.default = void 0;
|
|
9
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
10
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
11
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
12
|
-
var _apolloLink = require("apollo-link");
|
|
13
|
-
var _apolloLinkContext = require("apollo-link-context");
|
|
14
|
-
var _loadScript = _interopRequireDefault(require("load-script"));
|
|
15
|
-
var _react2 = require("@emotion/react");
|
|
16
|
-
var _plugins = require("@webiny/plugins");
|
|
17
|
-
var _useI18N2 = require("@webiny/app-i18n/hooks/useI18N");
|
|
18
|
-
var _appSecurity = require("@webiny/app-security");
|
|
19
|
-
var _Progress = require("@webiny/ui/Progress");
|
|
20
|
-
var _Playground = require("./Playground.styles");
|
|
21
|
-
var _settings = require("./settings");
|
|
22
|
-
var _config = require("@webiny/app/config");
|
|
1
|
+
import React, { Fragment, useEffect, useRef, useCallback, useState } from "react";
|
|
2
|
+
import { ApolloLink } from "apollo-link";
|
|
3
|
+
import { setContext } from "apollo-link-context";
|
|
23
4
|
/**
|
|
24
5
|
* Package load-script does not have types.
|
|
25
6
|
*/
|
|
26
7
|
// @ts-expect-error
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
8
|
+
import loadScript from "load-script";
|
|
9
|
+
import { Global } from "@emotion/react";
|
|
10
|
+
import { plugins } from "@webiny/plugins";
|
|
11
|
+
import { useIdentity } from "@webiny/app-admin";
|
|
12
|
+
import { CircularProgress } from "@webiny/ui/Progress/index.js";
|
|
13
|
+
import { playgroundDialog, PlaygroundContainer } from "./Playground.styles.js";
|
|
14
|
+
import { settings } from "./settings.js";
|
|
15
|
+
import { config as appConfig } from "@webiny/app/config.js";
|
|
16
|
+
import { ORIGINAL_GQL_PLAYGROUND_URL, PATCHED_GQL_PLAYGROUND_URL } from "./constants.js";
|
|
17
|
+
const withHeaders = (link, headers) => {
|
|
18
|
+
return ApolloLink.from([setContext(async (_, req) => {
|
|
30
19
|
return {
|
|
31
|
-
headers:
|
|
20
|
+
headers: {
|
|
21
|
+
...req.headers,
|
|
22
|
+
...headers
|
|
23
|
+
}
|
|
32
24
|
};
|
|
33
25
|
}), link]);
|
|
34
26
|
};
|
|
35
|
-
|
|
36
|
-
return new Promise(
|
|
27
|
+
const initScripts = () => {
|
|
28
|
+
return new Promise(resolve => {
|
|
37
29
|
// @ts-expect-error
|
|
38
30
|
if (window.GraphQLPlayground) {
|
|
39
31
|
return resolve();
|
|
40
32
|
}
|
|
41
|
-
|
|
33
|
+
loadScript(PATCHED_GQL_PLAYGROUND_URL, err => {
|
|
34
|
+
if (err) {
|
|
35
|
+
return loadScript(ORIGINAL_GQL_PLAYGROUND_URL, resolve);
|
|
36
|
+
}
|
|
37
|
+
resolve();
|
|
38
|
+
});
|
|
42
39
|
});
|
|
43
40
|
};
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
identity
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
});
|
|
61
|
-
}).filter(Boolean);
|
|
62
|
-
var createApolloLink = (0, _react.useCallback)(function (_ref2) {
|
|
63
|
-
var endpoint = _ref2.endpoint,
|
|
64
|
-
headers = _ref2.headers;
|
|
65
|
-
var current = links.current;
|
|
41
|
+
const Playground = ({
|
|
42
|
+
createApolloClient
|
|
43
|
+
}) => {
|
|
44
|
+
const [loading, setLoading] = useState(true);
|
|
45
|
+
const {
|
|
46
|
+
identity
|
|
47
|
+
} = useIdentity();
|
|
48
|
+
const links = useRef({});
|
|
49
|
+
const tabs = plugins.byType("graphql-playground-tab").map(pl => pl.tab({
|
|
50
|
+
identity: identity
|
|
51
|
+
})).filter(Boolean);
|
|
52
|
+
const createApolloLink = useCallback(({
|
|
53
|
+
endpoint,
|
|
54
|
+
headers
|
|
55
|
+
}) => {
|
|
56
|
+
const current = links.current;
|
|
66
57
|
// If the request endpoint is not know to us, return the first available
|
|
67
|
-
|
|
58
|
+
const apiUrl = appConfig.getKey("API_URL", process.env.REACT_APP_API_URL);
|
|
68
59
|
if (!endpoint.includes(apiUrl)) {
|
|
69
60
|
return {
|
|
70
61
|
link: withHeaders(Object.values(current)[0], headers)
|
|
@@ -79,29 +70,29 @@ var Playground = function Playground(_ref) {
|
|
|
79
70
|
link: withHeaders(current[endpoint], headers)
|
|
80
71
|
};
|
|
81
72
|
}, []);
|
|
82
|
-
|
|
83
|
-
initScripts().then(
|
|
73
|
+
useEffect(() => {
|
|
74
|
+
initScripts().then(() => {
|
|
84
75
|
setLoading(false);
|
|
85
76
|
});
|
|
86
77
|
}, []);
|
|
87
|
-
|
|
78
|
+
useEffect(() => {
|
|
88
79
|
if (!loading) {
|
|
89
80
|
// @ts-expect-error
|
|
90
81
|
window.GraphQLPlayground.init(document.getElementById("graphql-playground"), {
|
|
91
|
-
tabs
|
|
92
|
-
createApolloLink
|
|
93
|
-
settings
|
|
82
|
+
tabs,
|
|
83
|
+
createApolloLink,
|
|
84
|
+
settings
|
|
94
85
|
});
|
|
95
86
|
}
|
|
96
87
|
}, [loading]);
|
|
97
|
-
return /*#__PURE__*/
|
|
88
|
+
return /*#__PURE__*/React.createElement(Fragment, null, loading ? /*#__PURE__*/React.createElement(CircularProgress, {
|
|
98
89
|
label: "Loading playground..."
|
|
99
|
-
}) : /*#__PURE__*/
|
|
90
|
+
}) : /*#__PURE__*/React.createElement(PlaygroundContainer, {
|
|
100
91
|
id: "graphql-playground"
|
|
101
|
-
}), /*#__PURE__*/
|
|
102
|
-
styles:
|
|
92
|
+
}), /*#__PURE__*/React.createElement(Global, {
|
|
93
|
+
styles: playgroundDialog
|
|
103
94
|
}));
|
|
104
95
|
};
|
|
105
|
-
|
|
96
|
+
export default Playground;
|
|
106
97
|
|
|
107
98
|
//# sourceMappingURL=Playground.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["React","Fragment","useEffect","useRef","useCallback","useState","ApolloLink","setContext","loadScript","Global","plugins","useIdentity","CircularProgress","playgroundDialog","PlaygroundContainer","settings","config","appConfig","ORIGINAL_GQL_PLAYGROUND_URL","PATCHED_GQL_PLAYGROUND_URL","withHeaders","link","headers","from","_","req","initScripts","Promise","resolve","window","GraphQLPlayground","err","Playground","createApolloClient","loading","setLoading","identity","links","tabs","byType","map","pl","tab","filter","Boolean","createApolloLink","endpoint","current","apiUrl","getKey","process","env","REACT_APP_API_URL","includes","Object","values","uri","then","init","document","getElementById","createElement","label","id","styles"],"sources":["Playground.tsx"],"sourcesContent":["import React, { Fragment, useEffect, useRef, useCallback, useState } from \"react\";\nimport { ApolloLink } from \"apollo-link\";\nimport { setContext } from \"apollo-link-context\";\n/**\n * Package load-script does not have types.\n */\n// @ts-expect-error\nimport loadScript from \"load-script\";\nimport { Global } from \"@emotion/react\";\nimport { plugins } from \"@webiny/plugins\";\nimport { useIdentity } from \"@webiny/app-admin\";\nimport type { Identity } from \"@webiny/app-admin/domain/Identity.js\";\nimport { CircularProgress } from \"@webiny/ui/Progress/index.js\";\nimport { playgroundDialog, PlaygroundContainer } from \"./Playground.styles.js\";\nimport { settings } from \"./settings.js\";\nimport { config as appConfig } from \"@webiny/app/config.js\";\nimport type ApolloClient from \"apollo-client\";\nimport type { GraphQLPlaygroundTabPlugin } from \"~/types.js\";\nimport { ORIGINAL_GQL_PLAYGROUND_URL, PATCHED_GQL_PLAYGROUND_URL } from \"./constants.js\";\n\nconst withHeaders = (link: ApolloLink, headers: Record<string, string>): ApolloLink => {\n return ApolloLink.from([\n setContext(async (_, req) => {\n return {\n headers: {\n ...req.headers,\n ...headers\n }\n };\n }),\n link\n ]);\n};\n\nconst initScripts = () => {\n return new Promise((resolve: any) => {\n // @ts-expect-error\n if (window.GraphQLPlayground) {\n return resolve();\n }\n\n loadScript(PATCHED_GQL_PLAYGROUND_URL, (err: Error) => {\n if (err) {\n return loadScript(ORIGINAL_GQL_PLAYGROUND_URL, resolve);\n }\n\n resolve();\n });\n });\n};\n\ninterface CreateApolloClientParams {\n uri: string;\n}\n\ninterface PlaygroundProps {\n createApolloClient: (params: CreateApolloClientParams) => ApolloClient<any>;\n}\n\ninterface CreateApolloLinkCallableParams {\n endpoint: string;\n headers: Record<string, string>;\n}\n\ninterface CreateApolloLinkCallableResult {\n link: ApolloLink;\n}\n\ninterface CreateApolloLinkCallable {\n (params: CreateApolloLinkCallableParams): CreateApolloLinkCallableResult;\n}\n\nconst Playground = ({ createApolloClient }: PlaygroundProps) => {\n const [loading, setLoading] = useState(true);\n const { identity } = useIdentity();\n const links = useRef<Record<string, ApolloLink>>({});\n\n const tabs = plugins\n .byType<GraphQLPlaygroundTabPlugin>(\"graphql-playground-tab\")\n .map(pl =>\n pl.tab({\n identity: identity as Identity\n })\n )\n .filter(Boolean);\n\n const createApolloLink = useCallback<CreateApolloLinkCallable>(({ endpoint, headers }) => {\n const current = links.current;\n // If the request endpoint is not know to us, return the first available\n const apiUrl = appConfig.getKey(\"API_URL\", process.env.REACT_APP_API_URL) as string;\n if (!endpoint.includes(apiUrl)) {\n return { link: withHeaders(Object.values(current)[0], headers) };\n }\n\n if (!current[endpoint]) {\n current[endpoint] = createApolloClient({ uri: endpoint }).link;\n }\n\n return {\n link: withHeaders(current[endpoint], headers)\n };\n }, []);\n\n useEffect(() => {\n initScripts().then(() => {\n setLoading(false);\n });\n }, []);\n\n useEffect(() => {\n if (!loading) {\n // @ts-expect-error\n window.GraphQLPlayground.init(document.getElementById(\"graphql-playground\"), {\n tabs,\n createApolloLink,\n settings\n });\n }\n }, [loading]);\n\n return (\n <Fragment>\n {loading ? (\n <CircularProgress label={\"Loading playground...\"} />\n ) : (\n <PlaygroundContainer id={\"graphql-playground\"} />\n )}\n <Global styles={playgroundDialog} />\n </Fragment>\n );\n};\n\nexport default Playground;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,QAAQ,EAAEC,SAAS,EAAEC,MAAM,EAAEC,W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IACZ,IAAI,CAACgC,OAAO,EAAE;MACV;MACAL,MAAM,CAACC,iBAAiB,CAAC4B,IAAI,CAACC,QAAQ,CAACC,cAAc,CAAC,oBAAoB,CAAC,EAAE;QACzEtB,IAAI;QACJO,gBAAgB;QAChB9B;MACJ,CAAC,CAAC;IACN;EACJ,CAAC,EAAE,CAACmB,OAAO,CAAC,CAAC;EAEb,oBACIlC,KAAA,CAAA6D,aAAA,CAAC5D,QAAQ,QACJiC,OAAO,gBACJlC,KAAA,CAAA6D,aAAA,CAACjD,gBAAgB;IAACkD,KAAK,EAAE;EAAwB,CAAE,CAAC,gBAEpD9D,KAAA,CAAA6D,aAAA,CAAC/C,mBAAmB;IAACiD,EAAE,EAAE;EAAqB,CAAE,CACnD,eACD/D,KAAA,CAAA6D,aAAA,CAACpD,MAAM;IAACuD,MAAM,EAAEnD;EAAiB,CAAE,CAC7B,CAAC;AAEnB,CAAC;AAED,eAAemB,UAAU","ignoreList":[]}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
export declare const PlaygroundContainer: import("@emotion/styled").StyledComponent<{
|
|
3
|
-
theme?: import("@emotion/react").Theme
|
|
4
|
-
as?:
|
|
2
|
+
theme?: import("@emotion/react").Theme;
|
|
3
|
+
as?: React.ElementType;
|
|
5
4
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
6
5
|
export declare const playgroundDialog: {
|
|
7
6
|
".ReactModalPortal": {
|
|
@@ -1,13 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.playgroundDialog = exports.PlaygroundContainer = void 0;
|
|
8
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
9
|
-
var _base = _interopRequireDefault(require("@emotion/styled/base"));
|
|
10
|
-
var sharedStyles = {
|
|
1
|
+
import _styled from "@emotion/styled/base";
|
|
2
|
+
const sharedStyles = {
|
|
11
3
|
"p, a, h1, h2, h3, h4, ul, pre, code": {
|
|
12
4
|
margin: 0,
|
|
13
5
|
padding: 0,
|
|
@@ -26,7 +18,7 @@ var sharedStyles = {
|
|
|
26
18
|
fontFamily: "Consolas, monospace"
|
|
27
19
|
}
|
|
28
20
|
};
|
|
29
|
-
|
|
21
|
+
export const PlaygroundContainer = /*#__PURE__*/_styled("div", process.env.NODE_ENV === "production" ? {
|
|
30
22
|
target: "e1o47c380"
|
|
31
23
|
} : {
|
|
32
24
|
target: "e1o47c380",
|
|
@@ -34,8 +26,8 @@ var PlaygroundContainer = exports.PlaygroundContainer = /*#__PURE__*/(0, _base.d
|
|
|
34
26
|
})({
|
|
35
27
|
marginTop: -3,
|
|
36
28
|
overflow: "hidden",
|
|
37
|
-
".playground":
|
|
38
|
-
height: "calc(100vh -
|
|
29
|
+
".playground": {
|
|
30
|
+
height: "calc(100vh - 45px)",
|
|
39
31
|
margin: 0,
|
|
40
32
|
padding: 0,
|
|
41
33
|
fontFamily: "'Open Sans', sans-serif",
|
|
@@ -44,10 +36,11 @@ var PlaygroundContainer = exports.PlaygroundContainer = /*#__PURE__*/(0, _base.d
|
|
|
44
36
|
color: "rgba(0,0,0,.8)",
|
|
45
37
|
lineHeight: 1.5,
|
|
46
38
|
letterSpacing: 0.53,
|
|
47
|
-
marginRight: "-1px !important"
|
|
48
|
-
|
|
49
|
-
}
|
|
50
|
-
|
|
39
|
+
marginRight: "-1px !important",
|
|
40
|
+
...sharedStyles
|
|
41
|
+
}
|
|
42
|
+
}, process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIlBsYXlncm91bmQuc3R5bGVzLnRzIl0sIm5hbWVzIjpbXSwib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XCIsXG4gICAgICAgIFdlYmtpdEZvbnRTbW9vdGhpbmc6IFwiYW50aWFsaWFzZWRcIixcbiAgICAgICAgTW96T3N4Rm9udFNtb290aGluZzogXCJncmF5c2NhbGVcIixcbiAgICAgICAgY29sb3I6IFwicmdiYSgwLDAsMCwuOClcIixcbiAgICAgICAgbGluZUhlaWdodDogMS41LFxuICAgICAgICBsZXR0ZXJTcGFjaW5nOiAwLjUzLFxuICAgICAgICBtYXJnaW5SaWdodDogXCItMXB4ICFpbXBvcnRhbnRcIixcbiAgICAgICAgLi4uc2hhcmVkU3R5bGVzXG4gICAgfVxufSk7XG5cbmV4cG9ydCBjb25zdCBwbGF5Z3JvdW5kRGlhbG9nID0ge1xuICAgIFwiLlJlYWN0TW9kYWxQb3J0YWxcIjogc2hhcmVkU3R5bGVzXG59O1xuIl19 */");
|
|
43
|
+
export const playgroundDialog = {
|
|
51
44
|
".ReactModalPortal": sharedStyles
|
|
52
45
|
};
|
|
53
46
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["sharedStyles","margin","padding","color","outline","border","fontFamily","code","PlaygroundContainer","
|
|
1
|
+
{"version":3,"names":["sharedStyles","margin","padding","color","outline","border","fontFamily","code","PlaygroundContainer","_styled","process","env","NODE_ENV","target","label","marginTop","overflow","height","WebkitFontSmoothing","MozOsxFontSmoothing","lineHeight","letterSpacing","marginRight","playgroundDialog"],"sources":["Playground.styles.ts"],"sourcesContent":["import styled from \"@emotion/styled\";\n\nconst sharedStyles = {\n \"p, a, h1, h2, h3, h4, ul, pre, code\": {\n margin: 0,\n padding: 0,\n color: \"inherit\"\n },\n \"a:active, a:focus, button:focus, input:focus\": {\n outline: \"none\"\n },\n \"input, button, submit\": {\n border: \"none\"\n },\n \"input, button, pre\": {\n fontFamily: \"'Open Sans', sans-serif\"\n },\n code: {\n fontFamily: \"Consolas, monospace\"\n }\n};\n\nexport const PlaygroundContainer = styled(\"div\")({\n marginTop: -3,\n overflow: \"hidden\",\n \".playground\": {\n height: \"calc(100vh - 45px)\",\n margin: 0,\n padding: 0,\n fontFamily: \"'Open Sans', sans-serif\",\n WebkitFontSmoothing: \"antialiased\",\n MozOsxFontSmoothing: \"grayscale\",\n color: \"rgba(0,0,0,.8)\",\n lineHeight: 1.5,\n letterSpacing: 0.53,\n marginRight: \"-1px !important\",\n ...sharedStyles\n }\n});\n\nexport const playgroundDialog = {\n \".ReactModalPortal\": sharedStyles\n};\n"],"mappings":";AAEA,MAAMA,YAAY,GAAG;EACjB,qCAAqC,EAAE;IACnCC,MAAM,EAAE,CAAC;IACTC,OAAO,EAAE,CAAC;IACVC,KAAK,EAAE;EACX,CAAC;EACD,8CAA8C,EAAE;IAC5CC,OAAO,EAAE;EACb,CAAC;EACD,uBAAuB,EAAE;IACrBC,MAAM,EAAE;EACZ,CAAC;EACD,oBAAoB,EAAE;IAClBC,UAAU,EAAE;EAChB,CAAC;EACDC,IAAI,EAAE;IACFD,UAAU,EAAE;EAChB;AACJ,CAAC;AAED,OAAO,MAAME,mBAAmB,gBAAGC,OAAA,CAAO,KAAK,EAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAC,MAAA;AAAA;EAAAA,MAAA;EAAAC,KAAA;AAAA,EAAC,CAAC;EAC7CC,SAAS,EAAE,CAAC,CAAC;EACbC,QAAQ,EAAE,QAAQ;EAClB,aAAa,EAAE;IACXC,MAAM,EAAE,oBAAoB;IAC5BhB,MAAM,EAAE,CAAC;IACTC,OAAO,EAAE,CAAC;IACVI,UAAU,EAAE,yBAAyB;IACrCY,mBAAmB,EAAE,aAAa;IAClCC,mBAAmB,EAAE,WAAW;IAChChB,KAAK,EAAE,gBAAgB;IACvBiB,UAAU,EAAE,GAAG;IACfC,aAAa,EAAE,IAAI;IACnBC,WAAW,EAAE,iBAAiB;IAC9B,GAAGtB;EACP;AACJ,CAAC,EAAAU,OAAA,CAAAC,GAAA,CAAAC,QAAA,2tDAAC;AAEF,OAAO,MAAMW,gBAAgB,GAAG;EAC5B,mBAAmB,EAAEvB;AACzB,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const ORIGINAL_GQL_PLAYGROUND_URL = "https://cdn.jsdelivr.net/npm/@apollographql/graphql-playground-react@1.7.32/build/static/js/middleware.js";
|
|
2
|
+
export declare const PATCHED_GQL_PLAYGROUND_URL = "https://webiny-public.s3.us-east-2.amazonaws.com/project-scripts/gql-playground-mw-1.7.42-patched.js";
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export const ORIGINAL_GQL_PLAYGROUND_URL = "https://cdn.jsdelivr.net/npm/@apollographql/graphql-playground-react@1.7.32/build/static/js/middleware.js";
|
|
2
|
+
export const PATCHED_GQL_PLAYGROUND_URL = "https://webiny-public.s3.us-east-2.amazonaws.com/project-scripts/gql-playground-mw-1.7.42-patched.js";
|
|
3
|
+
|
|
4
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["ORIGINAL_GQL_PLAYGROUND_URL","PATCHED_GQL_PLAYGROUND_URL"],"sources":["constants.ts"],"sourcesContent":["export const ORIGINAL_GQL_PLAYGROUND_URL =\n \"https://cdn.jsdelivr.net/npm/@apollographql/graphql-playground-react@1.7.32/build/static/js/middleware.js\";\n\nexport const PATCHED_GQL_PLAYGROUND_URL =\n \"https://webiny-public.s3.us-east-2.amazonaws.com/project-scripts/gql-playground-mw-1.7.42-patched.js\";\n"],"mappings":"AAAA,OAAO,MAAMA,2BAA2B,GACpC,2GAA2G;AAE/G,OAAO,MAAMC,0BAA0B,GACnC,sGAAsG","ignoreList":[]}
|
package/plugins/index.d.ts
CHANGED
package/plugins/index.js
CHANGED
|
@@ -1,26 +1,18 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _placeholder = _interopRequireDefault(require("!!raw-loader!./placeholder.graphql"));
|
|
9
|
-
var _config = require("@webiny/app/config");
|
|
10
1
|
// @ts-expect-error
|
|
11
|
-
|
|
12
|
-
|
|
2
|
+
import placeholder from "!!raw-loader!./placeholder.graphql";
|
|
3
|
+
import { config as appConfig } from "@webiny/app/config.js";
|
|
4
|
+
const plugin = {
|
|
13
5
|
type: "graphql-playground-tab",
|
|
14
|
-
tab
|
|
15
|
-
|
|
6
|
+
tab() {
|
|
7
|
+
const apiUrl = appConfig.getKey("API_URL", process.env.REACT_APP_API_URL);
|
|
16
8
|
return {
|
|
17
9
|
name: "Main API",
|
|
18
10
|
endpoint: apiUrl + "/graphql",
|
|
19
11
|
headers: {},
|
|
20
|
-
query:
|
|
12
|
+
query: placeholder
|
|
21
13
|
};
|
|
22
14
|
}
|
|
23
15
|
};
|
|
24
|
-
|
|
16
|
+
export default [plugin];
|
|
25
17
|
|
|
26
18
|
//# sourceMappingURL=index.js.map
|
package/plugins/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["placeholder","config","appConfig","plugin","type","tab","apiUrl","getKey","process","env","REACT_APP_API_URL","name","endpoint","headers","query"],"sources":["index.tsx"],"sourcesContent":["import type { GraphQLPlaygroundTabPlugin } from \"~/types.js\";\n// @ts-expect-error\nimport placeholder from \"!!raw-loader!./placeholder.graphql\";\nimport { config as appConfig } from \"@webiny/app/config.js\";\n\nconst plugin: GraphQLPlaygroundTabPlugin = {\n type: \"graphql-playground-tab\",\n tab() {\n const apiUrl = appConfig.getKey(\"API_URL\", process.env.REACT_APP_API_URL) as string;\n return {\n name: \"Main API\",\n endpoint: apiUrl + \"/graphql\",\n headers: {},\n query: placeholder\n };\n }\n};\nexport default [plugin];\n"],"mappings":"AACA;AACA,OAAOA,WAAW,MAAM,oCAAoC;AAC5D,SAASC,MAAM,IAAIC,SAAS,QAAQ,uBAAuB;AAE3D,MAAMC,MAAkC,GAAG;EACvCC,IAAI,EAAE,wBAAwB;EAC9BC,GAAGA,CAAA,EAAG;IACF,MAAMC,MAAM,GAAGJ,SAAS,CAACK,MAAM,CAAC,SAAS,EAAEC,OAAO,CAACC,GAAG,CAACC,iBAAiB,CAAW;IACnF,OAAO;MACHC,IAAI,EAAE,UAAU;MAChBC,QAAQ,EAAEN,MAAM,GAAG,UAAU;MAC7BO,OAAO,EAAE,CAAC,CAAC;MACXC,KAAK,EAAEd;IACX,CAAC;EACL;AACJ,CAAC;AACD,eAAe,CAACG,MAAM,CAAC","ignoreList":[]}
|
package/plugins/settings.js
CHANGED
|
@@ -1,12 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.settings = void 0;
|
|
7
|
-
var settings = exports.settings = {
|
|
1
|
+
export const settings = {
|
|
8
2
|
"editor.cursorShape": "line",
|
|
9
|
-
"editor.fontFamily":
|
|
3
|
+
"editor.fontFamily": `'Source Code Pro', 'Consolas', 'Inconsolata', 'Droid Sans Mono', 'Monaco', monospace`,
|
|
10
4
|
"editor.fontSize": 14,
|
|
11
5
|
"editor.reuseHeaders": true,
|
|
12
6
|
"editor.theme": "dark",
|
package/plugins/settings.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["settings"
|
|
1
|
+
{"version":3,"names":["settings"],"sources":["settings.ts"],"sourcesContent":["export const settings: any = {\n \"editor.cursorShape\": \"line\",\n \"editor.fontFamily\": `'Source Code Pro', 'Consolas', 'Inconsolata', 'Droid Sans Mono', 'Monaco', monospace`,\n \"editor.fontSize\": 14,\n \"editor.reuseHeaders\": true,\n \"editor.theme\": \"dark\",\n \"general.betaUpdates\": false,\n \"prettier.printWidth\": 80,\n \"prettier.tabWidth\": 2,\n \"prettier.useTabs\": false,\n \"request.credentials\": \"omit\",\n \"schema.disableComments\": true,\n \"schema.polling.enable\": false,\n \"schema.polling.endpointFilter\": \"*localhost*\",\n \"schema.polling.interval\": 2000000,\n \"tracing.hideTracingResponse\": true,\n \"queryPlan.hideQueryPlanResponse\": true\n};\n"],"mappings":"AAAA,OAAO,MAAMA,QAAa,GAAG;EACzB,oBAAoB,EAAE,MAAM;EAC5B,mBAAmB,EAAE,sFAAsF;EAC3G,iBAAiB,EAAE,EAAE;EACrB,qBAAqB,EAAE,IAAI;EAC3B,cAAc,EAAE,MAAM;EACtB,qBAAqB,EAAE,KAAK;EAC5B,qBAAqB,EAAE,EAAE;EACzB,mBAAmB,EAAE,CAAC;EACtB,kBAAkB,EAAE,KAAK;EACzB,qBAAqB,EAAE,MAAM;EAC7B,wBAAwB,EAAE,IAAI;EAC9B,uBAAuB,EAAE,KAAK;EAC9B,+BAA+B,EAAE,aAAa;EAC9C,yBAAyB,EAAE,OAAO;EAClC,6BAA6B,EAAE,IAAI;EACnC,iCAAiC,EAAE;AACvC,CAAC","ignoreList":[]}
|
package/routes.d.ts
ADDED
package/routes.js
ADDED
package/routes.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Route","Routes","ApiPlayground","name","path"],"sources":["routes.ts"],"sourcesContent":["import { Route } from \"@webiny/app-admin\";\n\nexport const Routes = {\n ApiPlayground: new Route({\n name: \"ApiPlayground\",\n path: \"/api-playground\"\n })\n};\n"],"mappings":"AAAA,SAASA,KAAK,QAAQ,mBAAmB;AAEzC,OAAO,MAAMC,MAAM,GAAG;EAClBC,aAAa,EAAE,IAAIF,KAAK,CAAC;IACrBG,IAAI,EAAE,eAAe;IACrBC,IAAI,EAAE;EACV,CAAC;AACL,CAAC","ignoreList":[]}
|
package/types.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { Identity } from "@webiny/app-admin/domain/Identity.js";
|
|
2
|
+
import type { Plugin } from "@webiny/plugins/types.js";
|
|
3
3
|
export interface GraphQLPlaygroundTabParams {
|
|
4
|
-
|
|
5
|
-
identity: SecurityIdentity;
|
|
4
|
+
identity: Identity;
|
|
6
5
|
}
|
|
7
6
|
export interface GraphQLPlaygroundTab {
|
|
8
7
|
name: string;
|
|
@@ -10,7 +9,7 @@ export interface GraphQLPlaygroundTab {
|
|
|
10
9
|
headers: Record<string, string>;
|
|
11
10
|
query: string;
|
|
12
11
|
}
|
|
13
|
-
export
|
|
12
|
+
export type GraphQLPlaygroundTabPlugin = Plugin<{
|
|
14
13
|
type: "graphql-playground-tab";
|
|
15
14
|
tab: (params: GraphQLPlaygroundTabParams) => GraphQLPlaygroundTab | null;
|
|
16
15
|
}>;
|
package/types.js
CHANGED
package/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type { Identity } from \"@webiny/app-admin/domain/Identity.js\";\nimport type { Plugin } from \"@webiny/plugins/types.js\";\n\nexport interface GraphQLPlaygroundTabParams {\n identity: Identity;\n}\nexport interface GraphQLPlaygroundTab {\n name: string;\n endpoint: string;\n headers: Record<string, string>;\n query: string;\n}\n\nexport type GraphQLPlaygroundTabPlugin = Plugin<{\n type: \"graphql-playground-tab\";\n tab: (params: GraphQLPlaygroundTabParams) => GraphQLPlaygroundTab | null;\n}>;\n"],"mappings":"","ignoreList":[]}
|