@webiny/app-graphql-playground 5.23.1 → 5.25.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 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({ uri: string }: {
5
- uri: any;
6
- }): ApolloClient<any>;
7
+ createApolloClient(params: CreateApolloClientParams): ApolloClient<any>;
7
8
  }
8
- export declare const GraphQLPlayground: React.MemoExoticComponent<({ createApolloClient }: GraphQLPlaygroundProps) => JSX.Element>;
9
+ export declare const GraphQLPlayground: React.NamedExoticComponent<GraphQLPlaygroundProps>;
9
10
  export {};
package/index.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["index.tsx"],"names":["React","memo","plugins","Plugins","AddMenu","AddRoute","Layout","ReactComponent","InfoIcon","Playground","playgroundPlugins","GraphQLPlaygroundExtension","createApolloClient","register","GraphQLPlayground"],"mappings":"AAAA,OAAOA,KAAP,IAAgBC,IAAhB,QAA4B,OAA5B;AAEA,SAASC,OAAT,QAAwB,iBAAxB;AACA,SAASC,OAAT,EAAkBC,OAAlB,EAA2BC,QAA3B,EAAqCC,MAArC,QAAmD,mBAAnD;AACA,SAASC,cAAc,IAAIC,QAA3B;AACA,OAAOC,UAAP;AACA,OAAOC,iBAAP;;AASA,IAAMC,0BAA4D,GAAG,SAA/DA,0BAA+D,OAA4B;AAAA,MAAzBC,kBAAyB,QAAzBA,kBAAyB;AAC7FV,EAAAA,OAAO,CAACW,QAAR,CAAiBH,iBAAjB;AAEA,sBACI,oBAAC,OAAD,qBACI,oBAAC,OAAD;AACI,IAAA,IAAI,EAAE,eADV;AAEI,IAAA,KAAK,EAAE,gBAFX;AAGI,IAAA,IAAI,EAAE,iBAHV;AAII,IAAA,IAAI,eAAE,oBAAC,QAAD,OAJV;AAKI,IAAA,IAAI,EAAE,CAAC,QAAD;AALV,IADJ,eAQI,oBAAC,QAAD;AAAU,IAAA,KAAK,MAAf;AAAgB,IAAA,IAAI,EAAE;AAAtB,kBACI,oBAAC,MAAD;AAAQ,IAAA,KAAK,EAAE;AAAf,kBACI,oBAAC,UAAD;AAAY,IAAA,kBAAkB,EAAEE;AAAhC,IADJ,CADJ,CARJ,CADJ;AAgBH,CAnBD;;AAqBA,OAAO,IAAME,iBAAiB,gBAAGb,IAAI,CAACU,0BAAD,CAA9B","sourcesContent":["import React, { memo } from \"react\";\nimport { ApolloClient } from \"apollo-client\";\nimport { plugins } from \"@webiny/plugins\";\nimport { Plugins, AddMenu, AddRoute, Layout } from \"@webiny/app-admin\";\nimport { ReactComponent as InfoIcon } from \"./assets/graphql.svg\";\nimport Playground from \"./plugins/Playground\";\nimport playgroundPlugins from \"./plugins\";\n\ninterface CreateApolloClientParams {\n uri: string;\n}\ninterface GraphQLPlaygroundProps {\n createApolloClient(params: CreateApolloClientParams): ApolloClient<any>;\n}\n\nconst GraphQLPlaygroundExtension: React.FC<GraphQLPlaygroundProps> = ({ createApolloClient }) => {\n plugins.register(playgroundPlugins);\n\n return (\n <Plugins>\n <AddMenu\n name={\"apiPlayground\"}\n label={\"API Playground\"}\n path={\"/api-playground\"}\n icon={<InfoIcon />}\n tags={[\"footer\"]}\n />\n <AddRoute exact path={\"/api-playground\"}>\n <Layout title={\"API Playground\"}>\n <Playground createApolloClient={createApolloClient} />\n </Layout>\n </AddRoute>\n </Plugins>\n );\n};\n\nexport const GraphQLPlayground = memo(GraphQLPlaygroundExtension);\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webiny/app-graphql-playground",
3
- "version": "5.23.1",
3
+ "version": "5.25.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.23.1",
15
- "@webiny/app-admin": "5.23.1",
16
- "@webiny/app-i18n": "5.23.1",
17
- "@webiny/app-security": "5.23.1",
18
- "@webiny/plugins": "5.23.1",
19
- "@webiny/ui": "5.23.1",
14
+ "@webiny/app": "5.25.0-beta.0",
15
+ "@webiny/app-admin": "5.25.0-beta.0",
16
+ "@webiny/app-i18n": "5.25.0-beta.0",
17
+ "@webiny/app-security": "5.25.0-beta.0",
18
+ "@webiny/plugins": "5.25.0-beta.0",
19
+ "@webiny/ui": "5.25.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,12 +35,12 @@
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.23.1",
39
- "@webiny/project-utils": "^5.23.1",
38
+ "@webiny/cli": "^5.25.0-beta.0",
39
+ "@webiny/project-utils": "^5.25.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",
43
- "typescript": "^4.1.3"
43
+ "typescript": "4.5.5"
44
44
  },
45
45
  "publishConfig": {
46
46
  "access": "public",
@@ -60,5 +60,5 @@
60
60
  ]
61
61
  }
62
62
  },
63
- "gitHead": "a726d09d2647d13e5a4f376cef23463564ef7ca0"
63
+ "gitHead": "2d3e7833575e88fde77d84e5490e746933a5ec28"
64
64
  }
@@ -1,5 +1,10 @@
1
- /// <reference types="react" />
2
- declare const Playground: ({ createApolloClient }: {
3
- createApolloClient: any;
4
- }) => JSX.Element;
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;
@@ -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(links.current)[0], headers)
90
+ link: withHeaders(Object.values(current)[0], headers)
85
91
  };
86
92
  }
87
93
 
88
- if (!links.current[endpoint]) {
89
- links.current[endpoint] = createApolloClient({
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(links.current[endpoint], headers)
101
+ link: withHeaders(current[endpoint], headers)
96
102
  };
97
103
  }, []);
98
104
  useEffect(function () {
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["Playground.tsx"],"names":["React","Fragment","useEffect","useRef","useCallback","useState","ApolloLink","setContext","loadScript","Global","plugins","useI18N","useSecurity","CircularProgress","playgroundDialog","PlaygroundContainer","settings","config","appConfig","withHeaders","link","headers","from","_","req","initScripts","Promise","resolve","window","GraphQLPlayground","Playground","createApolloClient","loading","setLoading","getCurrentLocale","identity","links","locale","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"],"mappings":"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","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-ignore\nimport loadScript from \"load-script\";\nimport { Global } from \"@emotion/core\";\nimport { plugins } from \"@webiny/plugins\";\nimport { useI18N } from \"@webiny/app-i18n/hooks/useI18N\";\nimport { useSecurity } from \"@webiny/app-security\";\nimport { CircularProgress } from \"@webiny/ui/Progress\";\nimport { playgroundDialog, PlaygroundContainer } from \"./Playground.styles\";\nimport { settings } from \"./settings\";\nimport { config as appConfig } from \"@webiny/app/config\";\nimport ApolloClient from \"apollo-client\";\nimport { GraphQLPlaygroundTabPlugin } from \"~/types\";\nimport { SecurityIdentity } from \"@webiny/app-security/types\";\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-ignore\n if (window.GraphQLPlayground) {\n return resolve();\n }\n\n return loadScript(\n \"https://cdn.jsdelivr.net/npm/@apollographql/graphql-playground-react@1.7.32/build/static/js/middleware.js\",\n resolve\n );\n });\n};\n\ninterface CreateApolloClientParams {\n uri: string;\n}\ninterface PlaygroundProps {\n createApolloClient: (params: CreateApolloClientParams) => ApolloClient<any>;\n}\nconst Playground: React.FC<PlaygroundProps> = ({ createApolloClient }) => {\n const [loading, setLoading] = useState(true);\n const { getCurrentLocale } = useI18N();\n const { identity } = useSecurity();\n const links = useRef<Record<string, ApolloLink>>({});\n\n const locale = getCurrentLocale(\"content\");\n\n const tabs = plugins\n .byType<GraphQLPlaygroundTabPlugin>(\"graphql-playground-tab\")\n .map(pl =>\n pl.tab({\n locale: locale as string,\n identity: identity as SecurityIdentity\n })\n )\n .filter(Boolean);\n\n const createApolloLink = useCallback(({ 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);\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-ignore\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"]}
@@ -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>, "hidden" | "dir" | "slot" | "style" | "title" | "color" | "translate" | "children" | "defaultValue" | "id" | "defaultChecked" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "draggable" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "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" | "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>;
2
+ export declare const PlaygroundContainer: import("@emotion/styled-base").StyledComponent<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, Pick<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement>, keyof import("react").HTMLAttributes<HTMLDivElement>>, object>;
3
3
  export declare const playgroundDialog: {
4
4
  ".ReactModalPortal": {
5
5
  "p, a, h1, h2, h3, h4, ul, pre, code": {
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["Playground.styles.ts"],"names":["styled","sharedStyles","margin","padding","color","outline","border","fontFamily","code","PlaygroundContainer","marginTop","overflow","height","WebkitFontSmoothing","MozOsxFontSmoothing","lineHeight","letterSpacing","marginRight","playgroundDialog"],"mappings":";AAAA,OAAOA,MAAP,MAAmB,iBAAnB;AAEA,IAAMC,YAAY,GAAG;AACjB,yCAAuC;AACnCC,IAAAA,MAAM,EAAE,CAD2B;AAEnCC,IAAAA,OAAO,EAAE,CAF0B;AAGnCC,IAAAA,KAAK,EAAE;AAH4B,GADtB;AAMjB,kDAAgD;AAC5CC,IAAAA,OAAO,EAAE;AADmC,GAN/B;AASjB,2BAAyB;AACrBC,IAAAA,MAAM,EAAE;AADa,GATR;AAYjB,wBAAsB;AAClBC,IAAAA,UAAU,EAAE;AADM,GAZL;AAejBC,EAAAA,IAAI,EAAE;AACFD,IAAAA,UAAU,EAAE;AADV;AAfW,CAArB;AAoBA,OAAO,IAAME,mBAAmB,gBAAGT,MAAH,CAAU,KAAV;AAAA;AAAA;AAAA,GAAiB;AAC7CU,EAAAA,SAAS,EAAE,CAAC,CADiC;AAE7CC,EAAAA,QAAQ,EAAE,QAFmC;AAG7C;AACIC,IAAAA,MAAM,EAAE,oBADZ;AAEIV,IAAAA,MAAM,EAAE,CAFZ;AAGIC,IAAAA,OAAO,EAAE,CAHb;AAIII,IAAAA,UAAU,EAAE,yBAJhB;AAKIM,IAAAA,mBAAmB,EAAE,aALzB;AAMIC,IAAAA,mBAAmB,EAAE,WANzB;AAOIV,IAAAA,KAAK,EAAE,gBAPX;AAQIW,IAAAA,UAAU,EAAE,GARhB;AASIC,IAAAA,aAAa,EAAE,IATnB;AAUIC,IAAAA,WAAW,EAAE;AAVjB,KAWOhB,YAXP;AAH6C,CAAjB,CAAzB;AAkBP,OAAO,IAAMiB,gBAAgB,GAAG;AAC5B,uBAAqBjB;AADO,CAAzB","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 - 64px)\",\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"]}
@@ -1,8 +1,3 @@
1
- declare const _default: import("@webiny/plugins/types").Plugin<{
2
- type: "graphql-playground-tab";
3
- tab(params: {
4
- locale: string;
5
- identity: import("@webiny/app-security/types").SecurityIdentity;
6
- }): import("../types").GraphQLPlaygroundTab;
7
- }>[];
1
+ import { GraphQLPlaygroundTabPlugin } from "../types";
2
+ declare const _default: GraphQLPlaygroundTabPlugin[];
8
3
  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
- export default [{
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];
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["index.tsx"],"names":["placeholder","config","appConfig","plugin","type","tab","apiUrl","getKey","process","env","REACT_APP_API_URL","name","endpoint","headers","query"],"mappings":"AACA;AACA,OAAOA,WAAP,MAAwB,oCAAxB;AACA,SAASC,MAAM,IAAIC,SAAnB,QAAoC,oBAApC;AAEA,IAAMC,MAAkC,GAAG;AACvCC,EAAAA,IAAI,EAAE,wBADiC;AAEvCC,EAAAA,GAFuC,iBAEjC;AACF,QAAMC,MAAM,GAAGJ,SAAS,CAACK,MAAV,CAAiB,SAAjB,EAA4BC,OAAO,CAACC,GAAR,CAAYC,iBAAxC,CAAf;AACA,WAAO;AACHC,MAAAA,IAAI,EAAE,UADH;AAEHC,MAAAA,QAAQ,EAAEN,MAAM,GAAG,UAFhB;AAGHO,MAAAA,OAAO,EAAE,EAHN;AAIHC,MAAAA,KAAK,EAAEd;AAJJ,KAAP;AAMH;AAVsC,CAA3C;AAYA,eAAe,CAACG,MAAD,CAAf","sourcesContent":["import { GraphQLPlaygroundTabPlugin } from \"~/types\";\n// @ts-ignore\nimport placeholder from \"!!raw-loader!./placeholder.graphql\";\nimport { config as appConfig } from \"@webiny/app/config\";\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"]}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["settings.ts"],"names":["settings"],"mappings":"AAAA,OAAO,IAAMA,QAAa,GAAG;AACzB,wBAAsB,MADG;AAEzB,6GAFyB;AAGzB,qBAAmB,EAHM;AAIzB,yBAAuB,IAJE;AAKzB,kBAAgB,MALS;AAMzB,yBAAuB,KANE;AAOzB,yBAAuB,EAPE;AAQzB,uBAAqB,CARI;AASzB,sBAAoB,KATK;AAUzB,yBAAuB,MAVE;AAWzB,4BAA0B,IAXD;AAYzB,2BAAyB,KAZA;AAazB,mCAAiC,aAbR;AAczB,6BAA2B,OAdF;AAezB,iCAA+B,IAfN;AAgBzB,qCAAmC;AAhBV,CAAtB","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"]}
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 declare type GraphQLPlaygroundTab = {
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 | null;
15
16
  }>;
package/types.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}