@webiny/app-graphql-playground 5.23.0 → 5.24.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/index.d.ts +5 -4
- package/package.json +10 -10
- package/plugins/Playground.d.ts +9 -4
- package/plugins/Playground.js +11 -5
- package/plugins/Playground.styles.d.ts +1 -1
- package/plugins/index.d.ts +1 -4
- package/plugins/index.js +3 -2
- package/types.d.ts +7 -6
package/index.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { ApolloClient } from "apollo-client";
|
|
3
|
+
interface CreateApolloClientParams {
|
|
4
|
+
uri: string;
|
|
5
|
+
}
|
|
3
6
|
interface GraphQLPlaygroundProps {
|
|
4
|
-
createApolloClient(
|
|
5
|
-
uri: any;
|
|
6
|
-
}): ApolloClient<any>;
|
|
7
|
+
createApolloClient(params: CreateApolloClientParams): ApolloClient<any>;
|
|
7
8
|
}
|
|
8
|
-
export declare const GraphQLPlayground: React.
|
|
9
|
+
export declare const GraphQLPlayground: React.NamedExoticComponent<GraphQLPlaygroundProps>;
|
|
9
10
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/app-graphql-playground",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.24.0-beta.0",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -11,12 +11,12 @@
|
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@emotion/core": "10.3.1",
|
|
13
13
|
"@emotion/styled": "10.3.0",
|
|
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/ui": "5.
|
|
14
|
+
"@webiny/app": "5.24.0-beta.0",
|
|
15
|
+
"@webiny/app-admin": "5.24.0-beta.0",
|
|
16
|
+
"@webiny/app-i18n": "5.24.0-beta.0",
|
|
17
|
+
"@webiny/app-security": "5.24.0-beta.0",
|
|
18
|
+
"@webiny/plugins": "5.24.0-beta.0",
|
|
19
|
+
"@webiny/ui": "5.24.0-beta.0",
|
|
20
20
|
"apollo-cache": "1.3.5",
|
|
21
21
|
"apollo-client": "2.6.10",
|
|
22
22
|
"apollo-link": "1.2.14",
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
"@babel/preset-env": "^7.16.4",
|
|
36
36
|
"@babel/preset-react": "^7.16.0",
|
|
37
37
|
"@babel/preset-typescript": "^7.16.0",
|
|
38
|
-
"@webiny/cli": "^5.
|
|
39
|
-
"@webiny/project-utils": "^5.
|
|
38
|
+
"@webiny/cli": "^5.24.0-beta.0",
|
|
39
|
+
"@webiny/project-utils": "^5.24.0-beta.0",
|
|
40
40
|
"babel-plugin-emotion": "^9.2.8",
|
|
41
41
|
"babel-plugin-lodash": "^3.3.4",
|
|
42
42
|
"rimraf": "^3.0.2",
|
|
@@ -60,5 +60,5 @@
|
|
|
60
60
|
]
|
|
61
61
|
}
|
|
62
62
|
},
|
|
63
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "05b90b92bbaf2ef3adf275d008c4641580cf5f42"
|
|
64
64
|
}
|
package/plugins/Playground.d.ts
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import React from "react";
|
|
2
|
+
import ApolloClient from "apollo-client";
|
|
3
|
+
interface CreateApolloClientParams {
|
|
4
|
+
uri: string;
|
|
5
|
+
}
|
|
6
|
+
interface PlaygroundProps {
|
|
7
|
+
createApolloClient: (params: CreateApolloClientParams) => ApolloClient<any>;
|
|
8
|
+
}
|
|
9
|
+
declare const Playground: React.FC<PlaygroundProps>;
|
|
5
10
|
export default Playground;
|
package/plugins/Playground.js
CHANGED
|
@@ -5,6 +5,11 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
|
5
5
|
import React, { Fragment, useEffect, useRef, useCallback, useState } from "react";
|
|
6
6
|
import { ApolloLink } from "apollo-link";
|
|
7
7
|
import { setContext } from "apollo-link-context";
|
|
8
|
+
/**
|
|
9
|
+
* Package load-script does not have types.
|
|
10
|
+
*/
|
|
11
|
+
// @ts-ignore
|
|
12
|
+
|
|
8
13
|
import loadScript from "load-script";
|
|
9
14
|
import { Global } from "@emotion/core";
|
|
10
15
|
import { plugins } from "@webiny/plugins";
|
|
@@ -76,23 +81,24 @@ var Playground = function Playground(_ref2) {
|
|
|
76
81
|
var createApolloLink = useCallback(function (_ref3) {
|
|
77
82
|
var endpoint = _ref3.endpoint,
|
|
78
83
|
headers = _ref3.headers;
|
|
79
|
-
// If the request endpoint is not know to us, return the first available
|
|
84
|
+
var current = links.current; // If the request endpoint is not know to us, return the first available
|
|
85
|
+
|
|
80
86
|
var apiUrl = appConfig.getKey("API_URL", process.env.REACT_APP_API_URL);
|
|
81
87
|
|
|
82
88
|
if (!endpoint.includes(apiUrl)) {
|
|
83
89
|
return {
|
|
84
|
-
link: withHeaders(Object.values(
|
|
90
|
+
link: withHeaders(Object.values(current)[0], headers)
|
|
85
91
|
};
|
|
86
92
|
}
|
|
87
93
|
|
|
88
|
-
if (!
|
|
89
|
-
|
|
94
|
+
if (!current[endpoint]) {
|
|
95
|
+
current[endpoint] = createApolloClient({
|
|
90
96
|
uri: endpoint
|
|
91
97
|
}).link;
|
|
92
98
|
}
|
|
93
99
|
|
|
94
100
|
return {
|
|
95
|
-
link: withHeaders(
|
|
101
|
+
link: withHeaders(current[endpoint], headers)
|
|
96
102
|
};
|
|
97
103
|
}, []);
|
|
98
104
|
useEffect(function () {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
export declare const PlaygroundContainer: import("@emotion/styled-base").StyledComponent<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "
|
|
2
|
+
export declare const PlaygroundContainer: import("@emotion/styled-base").StyledComponent<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "slot" | "style" | "title" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "css">, object>;
|
|
3
3
|
export declare const playgroundDialog: {
|
|
4
4
|
".ReactModalPortal": {
|
|
5
5
|
"p, a, h1, h2, h3, h4, ul, pre, code": {
|
package/plugins/index.d.ts
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
declare const _default: import("@webiny/plugins/types").Plugin<{
|
|
2
2
|
type: "graphql-playground-tab";
|
|
3
|
-
tab(params:
|
|
4
|
-
locale: string;
|
|
5
|
-
identity: import("@webiny/app-security/types").SecurityIdentity;
|
|
6
|
-
}): import("../types").GraphQLPlaygroundTab;
|
|
3
|
+
tab(params: import("../types").GraphQLPlaygroundTabParams): import("../types").GraphQLPlaygroundTab;
|
|
7
4
|
}>[];
|
|
8
5
|
export default _default;
|
package/plugins/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @ts-ignore
|
|
2
2
|
import placeholder from "!!raw-loader!./placeholder.graphql";
|
|
3
3
|
import { config as appConfig } from "@webiny/app/config";
|
|
4
|
-
|
|
4
|
+
var plugin = {
|
|
5
5
|
type: "graphql-playground-tab",
|
|
6
6
|
tab: function tab() {
|
|
7
7
|
var apiUrl = appConfig.getKey("API_URL", process.env.REACT_APP_API_URL);
|
|
@@ -12,4 +12,5 @@ export default [{
|
|
|
12
12
|
query: placeholder
|
|
13
13
|
};
|
|
14
14
|
}
|
|
15
|
-
}
|
|
15
|
+
};
|
|
16
|
+
export default [plugin];
|
package/types.d.ts
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { Plugin } from "@webiny/plugins/types";
|
|
2
2
|
import { SecurityIdentity } from "@webiny/app-security/types";
|
|
3
|
-
export
|
|
3
|
+
export interface GraphQLPlaygroundTabParams {
|
|
4
|
+
locale: string;
|
|
5
|
+
identity: SecurityIdentity;
|
|
6
|
+
}
|
|
7
|
+
export interface GraphQLPlaygroundTab {
|
|
4
8
|
name: string;
|
|
5
9
|
endpoint: string;
|
|
6
10
|
headers: Record<string, string>;
|
|
7
11
|
query: string;
|
|
8
|
-
}
|
|
12
|
+
}
|
|
9
13
|
export declare type GraphQLPlaygroundTabPlugin = Plugin<{
|
|
10
14
|
type: "graphql-playground-tab";
|
|
11
|
-
tab(params:
|
|
12
|
-
locale: string;
|
|
13
|
-
identity: SecurityIdentity;
|
|
14
|
-
}): GraphQLPlaygroundTab;
|
|
15
|
+
tab(params: GraphQLPlaygroundTabParams): GraphQLPlaygroundTab;
|
|
15
16
|
}>;
|