@webiny/app-graphql-playground 5.18.1 → 5.18.3
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/package.json +11 -11
- package/plugins/Playground.js +4 -2
- package/plugins/index.js +3 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/app-graphql-playground",
|
|
3
|
-
"version": "5.18.
|
|
3
|
+
"version": "5.18.3",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -11,13 +11,13 @@
|
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@emotion/core": "10.1.1",
|
|
13
13
|
"@emotion/styled": "10.0.27",
|
|
14
|
-
"@webiny/app": "5.18.
|
|
15
|
-
"@webiny/app-admin": "5.18.
|
|
16
|
-
"@webiny/app-i18n": "5.18.
|
|
17
|
-
"@webiny/app-security": "5.18.
|
|
18
|
-
"@webiny/plugins": "5.18.
|
|
19
|
-
"@webiny/react-router": "5.18.
|
|
20
|
-
"@webiny/ui": "5.18.
|
|
14
|
+
"@webiny/app": "5.18.3",
|
|
15
|
+
"@webiny/app-admin": "5.18.3",
|
|
16
|
+
"@webiny/app-i18n": "5.18.3",
|
|
17
|
+
"@webiny/app-security": "5.18.3",
|
|
18
|
+
"@webiny/plugins": "5.18.3",
|
|
19
|
+
"@webiny/react-router": "5.18.3",
|
|
20
|
+
"@webiny/ui": "5.18.3",
|
|
21
21
|
"apollo-cache": "1.3.5",
|
|
22
22
|
"apollo-client": "2.6.10",
|
|
23
23
|
"apollo-link": "1.2.14",
|
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
"@babel/preset-env": "^7.5.5",
|
|
38
38
|
"@babel/preset-react": "^7.0.0",
|
|
39
39
|
"@babel/preset-typescript": "^7.8.3",
|
|
40
|
-
"@webiny/cli": "^5.18.
|
|
41
|
-
"@webiny/project-utils": "^5.18.
|
|
40
|
+
"@webiny/cli": "^5.18.3",
|
|
41
|
+
"@webiny/project-utils": "^5.18.3",
|
|
42
42
|
"babel-plugin-emotion": "^9.2.8",
|
|
43
43
|
"babel-plugin-lodash": "^3.3.4",
|
|
44
44
|
"rimraf": "^3.0.2",
|
|
@@ -67,5 +67,5 @@
|
|
|
67
67
|
]
|
|
68
68
|
}
|
|
69
69
|
},
|
|
70
|
-
"gitHead": "
|
|
70
|
+
"gitHead": "3ccdb07d10c57086a63eb42ba7484e17bc388297"
|
|
71
71
|
}
|
package/plugins/Playground.js
CHANGED
|
@@ -13,6 +13,7 @@ import { useSecurity } from "@webiny/app-security";
|
|
|
13
13
|
import { CircularProgress } from "@webiny/ui/Progress";
|
|
14
14
|
import { playgroundDialog, PlaygroundContainer } from "./Playground.styles";
|
|
15
15
|
import { settings } from "./settings";
|
|
16
|
+
import { config as appConfig } from "@webiny/app/config";
|
|
16
17
|
|
|
17
18
|
var withHeaders = function withHeaders(link, headers) {
|
|
18
19
|
return ApolloLink.from([setContext( /*#__PURE__*/function () {
|
|
@@ -75,9 +76,10 @@ var Playground = function Playground(_ref2) {
|
|
|
75
76
|
var createApolloLink = useCallback(function (_ref3) {
|
|
76
77
|
var endpoint = _ref3.endpoint,
|
|
77
78
|
headers = _ref3.headers;
|
|
78
|
-
|
|
79
79
|
// If the request endpoint is not know to us, return the first available
|
|
80
|
-
|
|
80
|
+
var apiUrl = appConfig.getKey("API_URL", process.env.REACT_APP_API_URL);
|
|
81
|
+
|
|
82
|
+
if (!endpoint.includes(apiUrl)) {
|
|
81
83
|
return {
|
|
82
84
|
link: withHeaders(Object.values(links.current)[0], headers)
|
|
83
85
|
};
|
package/plugins/index.js
CHANGED
|
@@ -9,6 +9,7 @@ import placeholder from "!!raw-loader!./placeholder.graphql";
|
|
|
9
9
|
import { NavigationMenuElement } from "@webiny/app-admin/ui/elements/NavigationMenuElement";
|
|
10
10
|
import { UIViewPlugin } from "@webiny/app-admin/ui/UIView";
|
|
11
11
|
import { NavigationView } from "@webiny/app-admin/ui/views/NavigationView";
|
|
12
|
+
import { config as appConfig } from "@webiny/app/config";
|
|
12
13
|
// @ts-ignore
|
|
13
14
|
export default (function (options) {
|
|
14
15
|
return [new UIViewPlugin(NavigationView, function (view) {
|
|
@@ -35,9 +36,10 @@ export default (function (options) {
|
|
|
35
36
|
}, {
|
|
36
37
|
type: "graphql-playground-tab",
|
|
37
38
|
tab: function tab() {
|
|
39
|
+
var apiUrl = appConfig.getKey("API_URL", process.env.REACT_APP_API_URL);
|
|
38
40
|
return {
|
|
39
41
|
name: "Main API",
|
|
40
|
-
endpoint:
|
|
42
|
+
endpoint: apiUrl + "/graphql",
|
|
41
43
|
headers: {},
|
|
42
44
|
query: placeholder
|
|
43
45
|
};
|