@webiny/app-graphql-playground 5.20.0-beta.0 → 5.21.0-beta.0
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/{plugins → assets}/graphql.svg +0 -0
- package/index.d.ts +9 -0
- package/index.js +27 -0
- package/package.json +11 -13
- package/plugins/index.d.ts +2 -11
- package/plugins/index.js +12 -45
|
File without changes
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ApolloClient } from "apollo-client";
|
|
3
|
+
interface GraphQLPlaygroundProps {
|
|
4
|
+
createApolloClient({ uri: string }: {
|
|
5
|
+
uri: any;
|
|
6
|
+
}): ApolloClient<any>;
|
|
7
|
+
}
|
|
8
|
+
export declare const GraphQLPlayground: React.MemoExoticComponent<({ createApolloClient }: GraphQLPlaygroundProps) => JSX.Element>;
|
|
9
|
+
export {};
|
package/index.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React, { memo } from "react";
|
|
2
|
+
import { plugins } from "@webiny/plugins";
|
|
3
|
+
import { Plugins, AddMenu, AddRoute, Layout } from "@webiny/app-admin";
|
|
4
|
+
import { ReactComponent as InfoIcon } from "@svgr/webpack!./assets/graphql.svg";
|
|
5
|
+
import Playground from "./plugins/Playground";
|
|
6
|
+
import playgroundPlugins from "./plugins";
|
|
7
|
+
|
|
8
|
+
var GraphQLPlaygroundExtension = function GraphQLPlaygroundExtension(_ref) {
|
|
9
|
+
var createApolloClient = _ref.createApolloClient;
|
|
10
|
+
plugins.register(playgroundPlugins);
|
|
11
|
+
return /*#__PURE__*/React.createElement(Plugins, null, /*#__PURE__*/React.createElement(AddMenu, {
|
|
12
|
+
name: "apiPlayground",
|
|
13
|
+
label: "API Playground",
|
|
14
|
+
path: "/api-playground",
|
|
15
|
+
icon: /*#__PURE__*/React.createElement(InfoIcon, null),
|
|
16
|
+
tags: ["footer"]
|
|
17
|
+
}), /*#__PURE__*/React.createElement(AddRoute, {
|
|
18
|
+
exact: true,
|
|
19
|
+
path: "/api-playground"
|
|
20
|
+
}, /*#__PURE__*/React.createElement(Layout, {
|
|
21
|
+
title: "API Playground"
|
|
22
|
+
}, /*#__PURE__*/React.createElement(Playground, {
|
|
23
|
+
createApolloClient: createApolloClient
|
|
24
|
+
}))));
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export var GraphQLPlayground = /*#__PURE__*/memo(GraphQLPlaygroundExtension);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/app-graphql-playground",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.21.0-beta.0",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -11,13 +11,12 @@
|
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@emotion/core": "10.1.1",
|
|
13
13
|
"@emotion/styled": "10.0.27",
|
|
14
|
-
"@webiny/app": "5.
|
|
15
|
-
"@webiny/app-admin": "5.
|
|
16
|
-
"@webiny/app-i18n": "5.
|
|
17
|
-
"@webiny/app-security": "5.
|
|
18
|
-
"@webiny/plugins": "5.
|
|
19
|
-
"@webiny/
|
|
20
|
-
"@webiny/ui": "5.20.0-beta.0",
|
|
14
|
+
"@webiny/app": "5.21.0-beta.0",
|
|
15
|
+
"@webiny/app-admin": "5.21.0-beta.0",
|
|
16
|
+
"@webiny/app-i18n": "5.21.0-beta.0",
|
|
17
|
+
"@webiny/app-security": "5.21.0-beta.0",
|
|
18
|
+
"@webiny/plugins": "5.21.0-beta.0",
|
|
19
|
+
"@webiny/ui": "5.21.0-beta.0",
|
|
21
20
|
"apollo-cache": "1.3.5",
|
|
22
21
|
"apollo-client": "2.6.10",
|
|
23
22
|
"apollo-link": "1.2.14",
|
|
@@ -27,8 +26,7 @@
|
|
|
27
26
|
"load-script": "1.0.0",
|
|
28
27
|
"prop-types": "15.7.2",
|
|
29
28
|
"react": "16.14.0",
|
|
30
|
-
"react-dom": "16.14.0"
|
|
31
|
-
"react-helmet": "5.2.1"
|
|
29
|
+
"react-dom": "16.14.0"
|
|
32
30
|
},
|
|
33
31
|
"devDependencies": {
|
|
34
32
|
"@babel/cli": "^7.5.5",
|
|
@@ -37,8 +35,8 @@
|
|
|
37
35
|
"@babel/preset-env": "^7.5.5",
|
|
38
36
|
"@babel/preset-react": "^7.0.0",
|
|
39
37
|
"@babel/preset-typescript": "^7.8.3",
|
|
40
|
-
"@webiny/cli": "^5.
|
|
41
|
-
"@webiny/project-utils": "^5.
|
|
38
|
+
"@webiny/cli": "^5.21.0-beta.0",
|
|
39
|
+
"@webiny/project-utils": "^5.21.0-beta.0",
|
|
42
40
|
"babel-plugin-emotion": "^9.2.8",
|
|
43
41
|
"babel-plugin-lodash": "^3.3.4",
|
|
44
42
|
"rimraf": "^3.0.2",
|
|
@@ -67,5 +65,5 @@
|
|
|
67
65
|
]
|
|
68
66
|
}
|
|
69
67
|
},
|
|
70
|
-
"gitHead": "
|
|
68
|
+
"gitHead": "cad155812edbdd577a1cc858b41038fdd7a6d2d9"
|
|
71
69
|
}
|
package/plugins/index.d.ts
CHANGED
|
@@ -1,17 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
import { RoutePlugin } from "@webiny/app/types";
|
|
3
|
-
import { UIViewPlugin } from "@webiny/app-admin/ui/UIView";
|
|
4
|
-
import { NavigationView } from "@webiny/app-admin/ui/views/NavigationView";
|
|
5
|
-
declare type GraphQLPlaygroundOptions = {
|
|
6
|
-
createApolloClient(params: {
|
|
7
|
-
uri: string;
|
|
8
|
-
}): ApolloClient<any>;
|
|
9
|
-
};
|
|
10
|
-
declare const _default: (options: GraphQLPlaygroundOptions) => (import("@webiny/plugins/types").Plugin<{
|
|
1
|
+
declare const _default: import("@webiny/plugins/types").Plugin<{
|
|
11
2
|
type: "graphql-playground-tab";
|
|
12
3
|
tab(params: {
|
|
13
4
|
locale: string;
|
|
14
5
|
identity: import("@webiny/app-security/types").SecurityIdentity;
|
|
15
6
|
}): import("../types").GraphQLPlaygroundTab;
|
|
16
|
-
}>
|
|
7
|
+
}>[];
|
|
17
8
|
export default _default;
|
package/plugins/index.js
CHANGED
|
@@ -1,48 +1,15 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import Helmet from "react-helmet";
|
|
3
|
-
import { Route } from "@webiny/react-router";
|
|
4
|
-
import { AdminLayout } from "@webiny/app-admin/components/AdminLayout";
|
|
5
|
-
import { ReactComponent as InfoIcon } from "@svgr/webpack!./graphql.svg";
|
|
6
|
-
import Playground from "./Playground";
|
|
7
1
|
// @ts-ignore
|
|
8
2
|
import placeholder from "!!raw-loader!./placeholder.graphql";
|
|
9
|
-
import { NavigationMenuElement } from "@webiny/app-admin/ui/elements/NavigationMenuElement";
|
|
10
|
-
import { UIViewPlugin } from "@webiny/app-admin/ui/UIView";
|
|
11
|
-
import { NavigationView } from "@webiny/app-admin/ui/views/NavigationView";
|
|
12
3
|
import { config as appConfig } from "@webiny/app/config";
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
name: "route-api-playground",
|
|
26
|
-
type: "route",
|
|
27
|
-
route: /*#__PURE__*/React.createElement(Route, {
|
|
28
|
-
exact: true,
|
|
29
|
-
path: "/api-playground",
|
|
30
|
-
render: function render() {
|
|
31
|
-
return /*#__PURE__*/React.createElement(AdminLayout, null, /*#__PURE__*/React.createElement(Helmet, null, /*#__PURE__*/React.createElement("title", null, "API Playground")), /*#__PURE__*/React.createElement(Playground, {
|
|
32
|
-
createApolloClient: options.createApolloClient
|
|
33
|
-
}));
|
|
34
|
-
}
|
|
35
|
-
})
|
|
36
|
-
}, {
|
|
37
|
-
type: "graphql-playground-tab",
|
|
38
|
-
tab: function tab() {
|
|
39
|
-
var apiUrl = appConfig.getKey("API_URL", process.env.REACT_APP_API_URL);
|
|
40
|
-
return {
|
|
41
|
-
name: "Main API",
|
|
42
|
-
endpoint: apiUrl + "/graphql",
|
|
43
|
-
headers: {},
|
|
44
|
-
query: placeholder
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
}];
|
|
48
|
-
});
|
|
4
|
+
export default [{
|
|
5
|
+
type: "graphql-playground-tab",
|
|
6
|
+
tab: function tab() {
|
|
7
|
+
var apiUrl = appConfig.getKey("API_URL", process.env.REACT_APP_API_URL);
|
|
8
|
+
return {
|
|
9
|
+
name: "Main API",
|
|
10
|
+
endpoint: apiUrl + "/graphql",
|
|
11
|
+
headers: {},
|
|
12
|
+
query: placeholder
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
}];
|