@graphiql/plugin-doc-explorer 0.0.2-canary-ee3ef668.0 → 0.0.2
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/dist/components/argument.d.ts +2 -1
- package/dist/components/argument.js +3 -3
- package/dist/components/argument.js.map +1 -1
- package/dist/components/default-value.d.ts +2 -1
- package/dist/components/default-value.js +2 -2
- package/dist/components/default-value.js.map +1 -1
- package/dist/components/deprecation-reason.d.ts +3 -2
- package/dist/components/deprecation-reason.js +2 -2
- package/dist/components/deprecation-reason.js.map +1 -1
- package/dist/components/directive.d.ts +2 -1
- package/dist/components/directive.js +2 -2
- package/dist/components/directive.js.map +1 -1
- package/dist/components/doc-explorer.d.ts +2 -1
- package/dist/components/doc-explorer.js +2 -2
- package/dist/components/doc-explorer.js.map +1 -1
- package/dist/components/field-documentation.d.ts +2 -1
- package/dist/components/field-documentation.js +66 -71
- package/dist/components/field-documentation.js.map +1 -1
- package/dist/components/field-link.d.ts +2 -1
- package/dist/components/field-link.js +26 -23
- package/dist/components/field-link.js.map +1 -1
- package/dist/components/schema-documentation.d.ts +2 -1
- package/dist/components/schema-documentation.js +98 -95
- package/dist/components/schema-documentation.js.map +1 -1
- package/dist/components/search.js +17 -14
- package/dist/components/search.js.map +1 -1
- package/dist/components/section.d.ts +2 -2
- package/dist/components/section.js +37 -33
- package/dist/components/section.js.map +1 -1
- package/dist/components/type-documentation.d.ts +2 -1
- package/dist/components/type-documentation.js +47 -44
- package/dist/components/type-documentation.js.map +1 -1
- package/dist/components/type-link.d.ts +2 -1
- package/dist/components/type-link.js +23 -20
- package/dist/components/type-link.js.map +1 -1
- package/dist/context.d.ts +3 -5
- package/dist/context.js +5 -5
- package/dist/context.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
1
2
|
import { GraphQLArgument } from 'graphql';
|
|
2
3
|
declare type ArgumentProps = {
|
|
3
4
|
/**
|
|
@@ -17,5 +18,5 @@ declare type ArgumentProps = {
|
|
|
17
18
|
*/
|
|
18
19
|
inline?: boolean;
|
|
19
20
|
};
|
|
20
|
-
export declare
|
|
21
|
+
export declare const Argument: FC<ArgumentProps>;
|
|
21
22
|
export {};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { c } from "react-compiler-runtime";
|
|
3
|
+
import { MarkdownContent } from "@graphiql/react";
|
|
3
4
|
import { DefaultValue } from "./default-value.js";
|
|
4
5
|
import { TypeLink } from "./type-link.js";
|
|
5
6
|
/* empty css */
|
|
6
|
-
|
|
7
|
-
function Argument(t0) {
|
|
7
|
+
const Argument = (t0) => {
|
|
8
8
|
const $ = c(19);
|
|
9
9
|
const {
|
|
10
10
|
arg,
|
|
@@ -89,7 +89,7 @@ function Argument(t0) {
|
|
|
89
89
|
t7 = $[18];
|
|
90
90
|
}
|
|
91
91
|
return t7;
|
|
92
|
-
}
|
|
92
|
+
};
|
|
93
93
|
export {
|
|
94
94
|
Argument
|
|
95
95
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"argument.js","sources":["../../src/components/argument.tsx"],"sourcesContent":["import { GraphQLArgument } from 'graphql';\
|
|
1
|
+
{"version":3,"file":"argument.js","sources":["../../src/components/argument.tsx"],"sourcesContent":["import { FC } from 'react';\nimport { GraphQLArgument } from 'graphql';\nimport { MarkdownContent } from '@graphiql/react';\nimport { DefaultValue } from './default-value';\nimport { TypeLink } from './type-link';\nimport './argument.css';\n\ntype ArgumentProps = {\n /**\n * The argument that should be rendered.\n */\n arg: GraphQLArgument;\n /**\n * Toggle if the default value for the argument is shown (if there is one)\n * @default false\n */\n showDefaultValue?: boolean;\n /**\n * Toggle whether to render the whole argument including description and\n * deprecation reason (`false`) or to just render the argument name, type,\n * and default value in a single line (`true`).\n * @default false\n */\n inline?: boolean;\n};\n\nexport const Argument: FC<ArgumentProps> = ({\n arg,\n showDefaultValue,\n inline,\n}) => {\n const definition = (\n <span>\n <span className=\"graphiql-doc-explorer-argument-name\">{arg.name}</span>\n {': '}\n <TypeLink type={arg.type} />\n {showDefaultValue !== false && <DefaultValue field={arg} />}\n </span>\n );\n if (inline) {\n return definition;\n }\n return (\n <div className=\"graphiql-doc-explorer-argument\">\n {definition}\n {arg.description ? (\n <MarkdownContent type=\"description\">{arg.description}</MarkdownContent>\n ) : null}\n {arg.deprecationReason ? (\n <div className=\"graphiql-doc-explorer-argument-deprecation\">\n <div className=\"graphiql-doc-explorer-argument-deprecation-label\">\n Deprecated\n </div>\n <MarkdownContent type=\"deprecation\">\n {arg.deprecationReason}\n </MarkdownContent>\n </div>\n ) : null}\n </div>\n );\n};\n"],"names":["Argument","t0","$","_c","arg","showDefaultValue","inline","t1","name","t2","type","t3","t4","definition","t5","description","t6","deprecationReason","t7"],"mappings":";;;;;;AA0BO,MAAMA,WAA8BC,CAAA,OAAA;AAAAC,QAAAA,IAAAC,EAAA,EAAA;AAAC,QAAA;AAAA,IAAAC;AAAAA,IAAAC;AAAAA,IAAAC;AAAAA,EAAAA,IAAAL;AAI3CM,MAAAA;AAAA,MAAAL,EAAA,CAAA,MAAAE,IAAAI,MAAA;AAGKD,SAAuE,oBAAA,QAAA,EAAvD,WAAA,uCAAuCH,cAAGI,MAAM;AAAO,MAAA,CAAA,IAAAJ,IAAAI;AAAAN,WAAAK;AAAAA,EAAAA,OAAA;AAAAA,SAAAL,EAAA,CAAA;AAAA,EAAA;AAAAO,MAAAA;AAAA,MAAAP,EAAA,CAAA,MAAAE,IAAAM,MAAA;AAEvED,SAAC,oBAAA,UAAA,EAAe,MAAAL,IAAGM,MAAS;AAAA,MAAA,CAAA,IAAAN,IAAAM;AAAAR,WAAAO;AAAAA,EAAAA,OAAA;AAAAA,SAAAP,EAAA,CAAA;AAAA,EAAA;AAAAS,MAAAA;AAAA,MAAAT,EAAAE,CAAAA,MAAAA,OAAAF,SAAAG,kBAAA;AAC3B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Y,MAAAZ,EAAA,EAAA,MAAAc,IAAA;AACJ,SAAA,qBAAA,OAfS,EAAA,WAAA,kCACZH,UAAAA;AAAAA,MAAAA;AAAAA,MACAC;AAAAA,MAGAE;AAAAA,IAAAA,GAUH;AAAMd,YAAAW;AAAAX,YAAAY;AAAAZ,YAAAc;AAAAd,YAAAgB;AAAAA,EAAAA,OAAA;AAAAA,SAAAhB,EAAA,EAAA;AAAA,EAAA;AAfNgB,SAAAA;AAeM;"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
1
2
|
import { ExplorerFieldDef } from '../context';
|
|
2
3
|
declare type DefaultValueProps = {
|
|
3
4
|
/**
|
|
@@ -5,5 +6,5 @@ declare type DefaultValueProps = {
|
|
|
5
6
|
*/
|
|
6
7
|
field: ExplorerFieldDef;
|
|
7
8
|
};
|
|
8
|
-
export declare
|
|
9
|
+
export declare const DefaultValue: FC<DefaultValueProps>;
|
|
9
10
|
export {};
|
|
@@ -8,7 +8,7 @@ const printDefault = (ast) => {
|
|
|
8
8
|
}
|
|
9
9
|
return print(ast);
|
|
10
10
|
};
|
|
11
|
-
|
|
11
|
+
const DefaultValue = (t0) => {
|
|
12
12
|
const $ = c(12);
|
|
13
13
|
const {
|
|
14
14
|
field
|
|
@@ -71,7 +71,7 @@ function DefaultValue(t0) {
|
|
|
71
71
|
t8 = $[11];
|
|
72
72
|
}
|
|
73
73
|
return t8;
|
|
74
|
-
}
|
|
74
|
+
};
|
|
75
75
|
export {
|
|
76
76
|
DefaultValue
|
|
77
77
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default-value.js","sources":["../../src/components/default-value.tsx"],"sourcesContent":["import { astFromValue, print, ValueNode } from 'graphql';\
|
|
1
|
+
{"version":3,"file":"default-value.js","sources":["../../src/components/default-value.tsx"],"sourcesContent":["import { FC } from 'react';\nimport { astFromValue, print, ValueNode } from 'graphql';\nimport { ExplorerFieldDef } from '../context';\nimport './default-value.css';\n\nconst printDefault = (ast?: ValueNode | null): string => {\n if (!ast) {\n return '';\n }\n return print(ast);\n};\n\ntype DefaultValueProps = {\n /**\n * The field or argument for which to render the default value.\n */\n field: ExplorerFieldDef;\n};\n\nexport const DefaultValue: FC<DefaultValueProps> = ({ field }) => {\n if (!('defaultValue' in field) || field.defaultValue === undefined) {\n return null;\n }\n const ast = astFromValue(field.defaultValue, field.type);\n if (!ast) {\n return null;\n }\n return (\n <>\n {' = '}\n <span className=\"graphiql-doc-explorer-default-value\">\n {printDefault(ast)}\n </span>\n </>\n );\n};\n"],"names":["printDefault","ast","print","DefaultValue","t0","$","_c","field","defaultValue","undefined","t1","t2","type","t3","t4","t5","t6","Symbol","for","astFromValue","bb0","t7","t8"],"mappings":";;;;AAKA,MAAMA,eAAeA,CAACC,QAAmC;AACvD,MAAI,CAACA,KAAK;AACD,WAAA;AAAA,EAAA;AAET,SAAOC,MAAMD,GAAG;AAClB;AASO,MAAME,eAAsCC,CAAA,OAAA;AAAAC,QAAAA,IAAAC,EAAA,EAAA;AAAC,QAAA;AAAA,IAAAC;AAAAA,EAAAA,IAAAH;AAAS,MACvD,EAAE,kBAAkBG,UAAUA,MAAKC,iBAAAC,QAA2B;AAAA,WAAA;AAAA,EAAA;AAGzC,QAAAC,KAAAH,MAAKC;AAAe,QAAAG,KAAAJ,MAAKK;AAAKC,MAAAA;AAAAC,MAAAA;AAAAC,MAAAA;AAAAC,MAAAA;AAAAX,MAAAA,EAAAE,CAAAA,MAAAA,MAAAC,gBAAAH,EAAA,CAAA,MAAAE,MAAAK,MAAA;AAE9CK,SAAAA,OAAAC,iCAAG;AAAC,SAAA;AAFbjB,YAAAA,MAAYkB,aAAaT,IAAoBC,EAAU;AAAE,UAAA,CACpDV,KAAG;AACC,aAAA;AAAImB,cAAAA;AAAAA,MAAAA;AAIH,WAAA;AAC+C,WAAA;AAClDN,WAAAd,aAAaC,GAAG;AAAA,IAAA;AAAC,MAAA,CAAA,IAAAM,MAAAC;AAAA,MAAA,CAAA,IAAAD,MAAAK;AAAAP,WAAAQ;AAAAR,WAAAS;AAAAT,WAAAU;AAAAV,WAAAW;AAAAA,EAAAA,OAAA;AAAAH,SAAAR,EAAA,CAAA;AAAAS,SAAAT,EAAA,CAAA;AAAAU,SAAAV,EAAA,CAAA;AAAAW,SAAAX,EAAA,CAAA;AAAA,EAAA;AAAA,MAAAW,OAAAC,OAAAC,IAAA,6BAAA,GAAA;AAAAF,WAAAA;AAAAA,EAAAA;AAAAK,MAAAA;AAAA,MAAAhB,EAAAQ,CAAAA,MAAAA,MAAAR,SAAAS,IAAA;AADpBO,SAEO,oBAAA,QAAA,EAFS,WAAAR,IACbC,UACH,IAAA;AAAOT,WAAAQ;AAAAR,WAAAS;AAAAT,WAAAgB;AAAAA,EAAAA,OAAA;AAAAA,SAAAhB,EAAA,CAAA;AAAA,EAAA;AAAAiB,MAAAA;AAAA,MAAAjB,EAAAU,CAAAA,MAAAA,MAAAV,UAAAgB,IAAA;AAJTC,SACGP,qBAAAA,UAAAA,EAAAA,UAAAA;AAAAA,MAAAA;AAAAA,MACDM;AAAAA,IAAAA,GAEO;AACNhB,WAAAU;AAAAV,YAAAgB;AAAAhB,YAAAiB;AAAAA,EAAAA,OAAA;AAAAA,SAAAjB,EAAA,EAAA;AAAA,EAAA;AALHiB,SAAAA;AAKG;"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
1
2
|
declare type DeprecationReasonProps = {
|
|
2
3
|
/**
|
|
3
|
-
* The deprecation reason as
|
|
4
|
+
* The deprecation reason as Markdown string.
|
|
4
5
|
*/
|
|
5
6
|
children?: string | null;
|
|
6
7
|
preview?: boolean;
|
|
7
8
|
};
|
|
8
|
-
export declare
|
|
9
|
+
export declare const DeprecationReason: FC<DeprecationReasonProps>;
|
|
9
10
|
export {};
|
|
@@ -2,7 +2,7 @@ import { jsxs, jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { c } from "react-compiler-runtime";
|
|
3
3
|
import { MarkdownContent } from "@graphiql/react";
|
|
4
4
|
/* empty css */
|
|
5
|
-
|
|
5
|
+
const DeprecationReason = (props) => {
|
|
6
6
|
const $ = c(3);
|
|
7
7
|
let t0;
|
|
8
8
|
if ($[0] !== props.children || $[1] !== props.preview) {
|
|
@@ -17,7 +17,7 @@ function DeprecationReason(props) {
|
|
|
17
17
|
t0 = $[2];
|
|
18
18
|
}
|
|
19
19
|
return t0;
|
|
20
|
-
}
|
|
20
|
+
};
|
|
21
21
|
export {
|
|
22
22
|
DeprecationReason
|
|
23
23
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deprecation-reason.js","sources":["../../src/components/deprecation-reason.tsx"],"sourcesContent":["import { MarkdownContent } from '@graphiql/react';\
|
|
1
|
+
{"version":3,"file":"deprecation-reason.js","sources":["../../src/components/deprecation-reason.tsx"],"sourcesContent":["import { FC } from 'react';\nimport { MarkdownContent } from '@graphiql/react';\nimport './deprecation-reason.css';\n\ntype DeprecationReasonProps = {\n /**\n * The deprecation reason as Markdown string.\n */\n children?: string | null;\n preview?: boolean;\n};\n\nexport const DeprecationReason: FC<DeprecationReasonProps> = props => {\n return props.children ? (\n <div className=\"graphiql-doc-explorer-deprecation\">\n <div className=\"graphiql-doc-explorer-deprecation-label\">Deprecated</div>\n <MarkdownContent\n type=\"deprecation\"\n onlyShowFirstChild={props.preview ?? true}\n >\n {props.children}\n </MarkdownContent>\n </div>\n ) : null;\n};\n"],"names":["DeprecationReason","props","$","_c","t0","children","preview"],"mappings":";;;;AAYO,MAAMA,oBAAgDC,CAAA,UAAA;AAAAC,QAAAA,IAAAC,EAAA,CAAA;AAAAC,MAAAA;AAAAF,MAAAA,EAAAD,CAAAA,MAAAA,MAAAI,YAAAH,EAAA,CAAA,MAAAD,MAAAK,SAAA;AACpDF,SAAAH,MAAKI,WASJ,qBAAA,OAAA,EARS,WAAA,qCACb,UAAA;AAAA,MAAyE,oBAAA,OAAA,EAA1D,WAAA,2CAA0C,UAAU,cAAA;AAAA,MACnE,oBAAC,mBACM,MAAA,eACe,oBAAAJ,MAAKK,WAAe,MAEvCL,UAAAA,MAAKI,SACR,CAAA;AAAA,IAAA,EAAA,CACF,IACM;AAAA,MAAA,CAAA,IAAAJ,MAAAI;AAAA,MAAA,CAAA,IAAAJ,MAAAK;AAAAJ,WAAAE;AAAAA,EAAAA,OAAA;AAAAA,SAAAF,EAAA,CAAA;AAAA,EAAA;AAVDE,SAAAA;AAUC;"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
1
2
|
import { DirectiveNode } from 'graphql';
|
|
2
3
|
declare type DirectiveProps = {
|
|
3
4
|
/**
|
|
@@ -5,5 +6,5 @@ declare type DirectiveProps = {
|
|
|
5
6
|
*/
|
|
6
7
|
directive: DirectiveNode;
|
|
7
8
|
};
|
|
8
|
-
export declare
|
|
9
|
+
export declare const Directive: FC<DirectiveProps>;
|
|
9
10
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { c } from "react-compiler-runtime";
|
|
3
3
|
/* empty css */
|
|
4
|
-
|
|
4
|
+
const Directive = (t0) => {
|
|
5
5
|
const $ = c(2);
|
|
6
6
|
const {
|
|
7
7
|
directive
|
|
@@ -18,7 +18,7 @@ function Directive(t0) {
|
|
|
18
18
|
t1 = $[1];
|
|
19
19
|
}
|
|
20
20
|
return t1;
|
|
21
|
-
}
|
|
21
|
+
};
|
|
22
22
|
export {
|
|
23
23
|
Directive
|
|
24
24
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"directive.js","sources":["../../src/components/directive.tsx"],"sourcesContent":["import { DirectiveNode } from 'graphql';\
|
|
1
|
+
{"version":3,"file":"directive.js","sources":["../../src/components/directive.tsx"],"sourcesContent":["import { FC } from 'react';\nimport { DirectiveNode } from 'graphql';\nimport './directive.css';\n\ntype DirectiveProps = {\n /**\n * The directive that should be rendered.\n */\n directive: DirectiveNode;\n};\n\nexport const Directive: FC<DirectiveProps> = ({ directive }) => {\n return (\n <span className=\"graphiql-doc-explorer-directive\">\n @{directive.name.value}\n </span>\n );\n};\n"],"names":["Directive","t0","$","_c","directive","t1","name","value"],"mappings":";;;AAWO,MAAMA,YAAgCC,CAAA,OAAA;AAAAC,QAAAA,IAAAC,EAAA,CAAA;AAAC,QAAA;AAAA,IAAAC;AAAAA,EAAAA,IAAAH;AAAaI,MAAAA;AAAA,MAAAH,EAAAE,CAAAA,MAAAA,UAAAE,KAAAC,OAAA;AAIhD,SAAA,qBAAA,QAFS,EAAA,WAAA,mCAAkC,UAAA;AAAA,MAAA;AAAA,MAC9CH,UAASE,KAAAC;AAAAA,IAAAA,GACb;AAAOH,MAAAA,CAAAA,IAAAA,UAAAE,KAAAC;AAAAL,WAAAG;AAAAA,EAAAA,OAAA;AAAAA,SAAAH,EAAA,CAAA;AAAA,EAAA;AAFPG,SAAAA;AAEO;"}
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
export declare const DocExplorer: FC;
|
|
@@ -8,7 +8,7 @@ import { SchemaDocumentation } from "./schema-documentation.js";
|
|
|
8
8
|
import { Search } from "./search.js";
|
|
9
9
|
import { TypeDocumentation } from "./type-documentation.js";
|
|
10
10
|
/* empty css */
|
|
11
|
-
|
|
11
|
+
const DocExplorer = () => {
|
|
12
12
|
const $ = c(40);
|
|
13
13
|
let t0;
|
|
14
14
|
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
@@ -227,7 +227,7 @@ function DocExplorer() {
|
|
|
227
227
|
t8 = $[39];
|
|
228
228
|
}
|
|
229
229
|
return t8;
|
|
230
|
-
}
|
|
230
|
+
};
|
|
231
231
|
export {
|
|
232
232
|
DocExplorer
|
|
233
233
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"doc-explorer.js","sources":["../../src/components/doc-explorer.tsx"],"sourcesContent":["import { isType } from 'graphql';\nimport { ReactNode } from 'react';\
|
|
1
|
+
{"version":3,"file":"doc-explorer.js","sources":["../../src/components/doc-explorer.tsx"],"sourcesContent":["import { isType } from 'graphql';\nimport { FC, ReactNode } from 'react';\nimport { ChevronLeftIcon, Spinner, useSchemaContext } from '@graphiql/react';\nimport { useExplorerContext } from '../context';\nimport { FieldDocumentation } from './field-documentation';\nimport { SchemaDocumentation } from './schema-documentation';\nimport { Search } from './search';\nimport { TypeDocumentation } from './type-documentation';\nimport './doc-explorer.css';\n\nexport const DocExplorer: FC = () => {\n const { fetchError, isFetching, schema, validationErrors } = useSchemaContext(\n { nonNull: true, caller: DocExplorer },\n );\n const { explorerNavStack, pop } = useExplorerContext({\n nonNull: true,\n caller: DocExplorer,\n });\n\n const navItem = explorerNavStack.at(-1)!;\n\n let content: ReactNode = null;\n if (fetchError) {\n content = (\n <div className=\"graphiql-doc-explorer-error\">Error fetching schema</div>\n );\n } else if (validationErrors.length > 0) {\n content = (\n <div className=\"graphiql-doc-explorer-error\">\n Schema is invalid: {validationErrors[0].message}\n </div>\n );\n } else if (isFetching) {\n // Schema is undefined when it is being loaded via introspection.\n content = <Spinner />;\n } else if (!schema) {\n // Schema is null when it explicitly does not exist, typically due to\n // an error during introspection.\n content = (\n <div className=\"graphiql-doc-explorer-error\">\n No GraphQL schema available\n </div>\n );\n } else if (explorerNavStack.length === 1) {\n content = <SchemaDocumentation schema={schema} />;\n } else if (isType(navItem.def)) {\n content = <TypeDocumentation type={navItem.def} />;\n } else if (navItem.def) {\n content = <FieldDocumentation field={navItem.def} />;\n }\n\n let prevName;\n if (explorerNavStack.length > 1) {\n prevName = explorerNavStack.at(-2)!.name;\n }\n\n return (\n <section\n className=\"graphiql-doc-explorer\"\n aria-label=\"Documentation Explorer\"\n >\n <div className=\"graphiql-doc-explorer-header\">\n <div className=\"graphiql-doc-explorer-header-content\">\n {prevName && (\n <a\n href=\"#\"\n className=\"graphiql-doc-explorer-back\"\n onClick={event => {\n event.preventDefault();\n pop();\n }}\n aria-label={`Go back to ${prevName}`}\n >\n <ChevronLeftIcon />\n {prevName}\n </a>\n )}\n <div className=\"graphiql-doc-explorer-title\">{navItem.name}</div>\n </div>\n <Search key={navItem.name} />\n </div>\n <div className=\"graphiql-doc-explorer-content\">{content}</div>\n </section>\n );\n};\n"],"names":["DocExplorer","$","_c","t0","Symbol","for","nonNull","caller","fetchError","isFetching","schema","validationErrors","useSchemaContext","t1","explorerNavStack","pop","useExplorerContext","content","navItem","at","t2","length","message","isType","def","prevName","event","preventDefault","t3","name","t4","t5","t6","t7","t8"],"mappings":";;;;;;;;;;AAUO,MAAMA,cAAkBA,MAAA;AAAAC,QAAAA,IAAAC,EAAA,EAAA;AAAAC,MAAAA;AAAA,MAAAF,EAAA,CAAA,MAAAG,OAAAC,IAAA,2BAAA,GAAA;AAE3B,SAAA;AAAA,MAAAC,SAAA;AAAA,MAAAC,QAAAP;AAAAA,IAAA;AAAsCC,WAAAE;AAAAA,EAAAA,OAAA;AAAAA,SAAAF,EAAA,CAAA;AAAA,EAAA;AADxC,QAAA;AAAA,IAAAO;AAAAA,IAAAC;AAAAA,IAAAC;AAAAA,IAAAC;AAAAA,EAAAA,IAA6DC,iBAC3DT,EACF;AAAEU,MAAAA;AAAA,MAAAZ,EAAA,CAAA,MAAAG,OAAAC,IAAA,2BAAA,GAAA;AACmD,SAAA;AAAA,MAAAC,SAAA;AAAA,MAAAC,QAAAP;AAAAA,IAAA;AAGpDC,WAAAY;AAAAA,EAAAA,OAAA;AAAAA,SAAAZ,EAAA,CAAA;AAAA,EAAA;AAHD,QAAA;AAAA,IAAAa;AAAAA,IAAAC;AAAAA,EAAAA,IAAkCC,mBAAmBH,EAGpD;AAAEI,MAAAA;AAAAC,MAAAA;AAAA,MAAAjB,EAAAa,CAAAA,MAAAA,oBAAAb,EAAA,CAAA,MAAAO,cAAAP,EAAAQ,CAAAA,MAAAA,cAAAR,EAAA,CAAA,MAAAS,UAAAT,SAAAU,kB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EAAA,IAAAX,QAAAW;AAAA5B,YAAA8B;AAAAA,EAAAA,OAAA;AAAAA,SAAA9B,EAAA,EAAA;AAAA,EAAA;AAAA+B,MAAAA;AAAA,MAAA/B,EAAA6B,EAAAA,MAAAA,MAAA7B,UAAA8B,IAAA;AACzB,SAAA,qBAAA,OAnBS,EAAA,WAAA,gCACbD,UAAAA;AAAAA,MAAAA;AAAAA,MAiBAC;AAAAA,IAAAA,GACF;AAAM9B,YAAA6B;AAAA7B,YAAA8B;AAAA9B,YAAA+B;AAAAA,EAAAA,OAAA;AAAAA,SAAA/B,EAAA,EAAA;AAAA,EAAA;AAAAgC,MAAAA;AAAAhC,MAAAA,UAAAgB,SAAA;AACNgB,SAAA,oBAAA,OAAA,EAAe,WAAA,iCAAiChB,UAAQ,SAAA;AAAMhB,YAAAgB;AAAAhB,YAAAgC;AAAAA,EAAAA,OAAA;AAAAA,SAAAhC,EAAA,EAAA;AAAA,EAAA;AAAAiC,MAAAA;AAAA,MAAAjC,EAAA+B,EAAAA,MAAAA,MAAA/B,UAAAgC,IAAA;AAxBhEC,2CACY,WAAA,yBACC,cAAA,0BAEXF,UAAAA;AAAAA,MAAAA;AAAAA,MAoBAC;AAAAA,IAAAA,GACF;AAAUhC,YAAA+B;AAAA/B,YAAAgC;AAAAhC,YAAAiC;AAAAA,EAAAA,OAAA;AAAAA,SAAAjC,EAAA,EAAA;AAAA,EAAA;AAzBViC,SAAAA;AAyBU;"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
1
2
|
import { ExplorerFieldDef } from '../context';
|
|
2
3
|
declare type FieldDocumentationProps = {
|
|
3
4
|
/**
|
|
@@ -5,5 +6,5 @@ declare type FieldDocumentationProps = {
|
|
|
5
6
|
*/
|
|
6
7
|
field: ExplorerFieldDef;
|
|
7
8
|
};
|
|
8
|
-
export declare
|
|
9
|
+
export declare const FieldDocumentation: FC<FieldDocumentationProps>;
|
|
9
10
|
export {};
|
|
@@ -7,65 +7,68 @@ import { DeprecationReason } from "./deprecation-reason.js";
|
|
|
7
7
|
import { Directive } from "./directive.js";
|
|
8
8
|
import { ExplorerSection } from "./section.js";
|
|
9
9
|
import { TypeLink } from "./type-link.js";
|
|
10
|
-
|
|
10
|
+
const FieldDocumentation = (t0) => {
|
|
11
11
|
const $ = c(15);
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
$[0] = props.field.description;
|
|
16
|
-
$[1] = t0;
|
|
17
|
-
} else {
|
|
18
|
-
t0 = $[1];
|
|
19
|
-
}
|
|
12
|
+
const {
|
|
13
|
+
field
|
|
14
|
+
} = t0;
|
|
20
15
|
let t1;
|
|
21
|
-
if ($[
|
|
22
|
-
t1 = /* @__PURE__ */ jsx(
|
|
23
|
-
$[
|
|
24
|
-
$[
|
|
16
|
+
if ($[0] !== field.description) {
|
|
17
|
+
t1 = field.description ? /* @__PURE__ */ jsx(MarkdownContent, { type: "description", children: field.description }) : null;
|
|
18
|
+
$[0] = field.description;
|
|
19
|
+
$[1] = t1;
|
|
25
20
|
} else {
|
|
26
|
-
t1 = $[
|
|
21
|
+
t1 = $[1];
|
|
27
22
|
}
|
|
28
23
|
let t2;
|
|
29
|
-
if ($[
|
|
30
|
-
t2 = /* @__PURE__ */ jsx(
|
|
31
|
-
$[
|
|
32
|
-
$[
|
|
24
|
+
if ($[2] !== field.deprecationReason) {
|
|
25
|
+
t2 = /* @__PURE__ */ jsx(DeprecationReason, { preview: false, children: field.deprecationReason });
|
|
26
|
+
$[2] = field.deprecationReason;
|
|
27
|
+
$[3] = t2;
|
|
33
28
|
} else {
|
|
34
|
-
t2 = $[
|
|
29
|
+
t2 = $[3];
|
|
35
30
|
}
|
|
36
31
|
let t3;
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
$[6] = props.field;
|
|
42
|
-
$[7] = t3;
|
|
43
|
-
$[8] = t4;
|
|
32
|
+
if ($[4] !== field.type) {
|
|
33
|
+
t3 = /* @__PURE__ */ jsx(ExplorerSection, { title: "Type", children: /* @__PURE__ */ jsx(TypeLink, { type: field.type }) });
|
|
34
|
+
$[4] = field.type;
|
|
35
|
+
$[5] = t3;
|
|
44
36
|
} else {
|
|
45
|
-
t3 = $[
|
|
46
|
-
t4 = $[8];
|
|
37
|
+
t3 = $[5];
|
|
47
38
|
}
|
|
39
|
+
let t4;
|
|
48
40
|
let t5;
|
|
49
|
-
if ($[
|
|
50
|
-
|
|
51
|
-
|
|
41
|
+
if ($[6] !== field) {
|
|
42
|
+
t4 = /* @__PURE__ */ jsx(Arguments, { field });
|
|
43
|
+
t5 = /* @__PURE__ */ jsx(Directives, { field });
|
|
44
|
+
$[6] = field;
|
|
45
|
+
$[7] = t4;
|
|
46
|
+
$[8] = t5;
|
|
47
|
+
} else {
|
|
48
|
+
t4 = $[7];
|
|
49
|
+
t5 = $[8];
|
|
50
|
+
}
|
|
51
|
+
let t6;
|
|
52
|
+
if ($[9] !== t1 || $[10] !== t2 || $[11] !== t3 || $[12] !== t4 || $[13] !== t5) {
|
|
53
|
+
t6 = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
52
54
|
t1,
|
|
53
55
|
t2,
|
|
54
56
|
t3,
|
|
55
|
-
t4
|
|
57
|
+
t4,
|
|
58
|
+
t5
|
|
56
59
|
] });
|
|
57
|
-
$[9] =
|
|
58
|
-
$[10] =
|
|
59
|
-
$[11] =
|
|
60
|
-
$[12] =
|
|
61
|
-
$[13] =
|
|
62
|
-
$[14] =
|
|
60
|
+
$[9] = t1;
|
|
61
|
+
$[10] = t2;
|
|
62
|
+
$[11] = t3;
|
|
63
|
+
$[12] = t4;
|
|
64
|
+
$[13] = t5;
|
|
65
|
+
$[14] = t6;
|
|
63
66
|
} else {
|
|
64
|
-
|
|
67
|
+
t6 = $[14];
|
|
65
68
|
}
|
|
66
|
-
return
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
+
return t6;
|
|
70
|
+
};
|
|
71
|
+
const Arguments = (t0) => {
|
|
69
72
|
const $ = c(12);
|
|
70
73
|
const {
|
|
71
74
|
field
|
|
@@ -130,48 +133,40 @@ function Arguments(t0) {
|
|
|
130
133
|
t4 = $[11];
|
|
131
134
|
}
|
|
132
135
|
return t4;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
function _temp(arg) {
|
|
138
|
-
return /* @__PURE__ */ jsx(Argument, { arg }, arg.name);
|
|
139
|
-
}
|
|
140
|
-
function Directives(t0) {
|
|
141
|
-
var _a, _b, _c;
|
|
142
|
-
const $ = c(6);
|
|
136
|
+
};
|
|
137
|
+
const Directives = (t0) => {
|
|
138
|
+
var _a;
|
|
139
|
+
const $ = c(4);
|
|
143
140
|
const {
|
|
144
141
|
field
|
|
145
142
|
} = t0;
|
|
143
|
+
const directives = (_a = field.astNode) == null ? void 0 : _a.directives;
|
|
144
|
+
if (!(directives == null ? void 0 : directives.length)) {
|
|
145
|
+
return null;
|
|
146
|
+
}
|
|
146
147
|
let t1;
|
|
147
|
-
if ($[0] !==
|
|
148
|
-
t1 = (
|
|
149
|
-
$[0] =
|
|
148
|
+
if ($[0] !== directives) {
|
|
149
|
+
t1 = directives.map(_temp3);
|
|
150
|
+
$[0] = directives;
|
|
150
151
|
$[1] = t1;
|
|
151
152
|
} else {
|
|
152
153
|
t1 = $[1];
|
|
153
154
|
}
|
|
154
|
-
const directives = t1;
|
|
155
|
-
if (!directives || directives.length === 0) {
|
|
156
|
-
return null;
|
|
157
|
-
}
|
|
158
155
|
let t2;
|
|
159
|
-
if ($[2] !==
|
|
160
|
-
t2 =
|
|
161
|
-
$[2] =
|
|
156
|
+
if ($[2] !== t1) {
|
|
157
|
+
t2 = /* @__PURE__ */ jsx(ExplorerSection, { title: "Directives", children: t1 });
|
|
158
|
+
$[2] = t1;
|
|
162
159
|
$[3] = t2;
|
|
163
160
|
} else {
|
|
164
161
|
t2 = $[3];
|
|
165
162
|
}
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
}
|
|
174
|
-
return t3;
|
|
163
|
+
return t2;
|
|
164
|
+
};
|
|
165
|
+
function _temp(arg) {
|
|
166
|
+
return /* @__PURE__ */ jsx(Argument, { arg }, arg.name);
|
|
167
|
+
}
|
|
168
|
+
function _temp2(arg_0) {
|
|
169
|
+
return /* @__PURE__ */ jsx(Argument, { arg: arg_0 }, arg_0.name);
|
|
175
170
|
}
|
|
176
171
|
function _temp3(directive) {
|
|
177
172
|
return /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(Directive, { directive }) }, directive.name.value);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"field-documentation.js","sources":["../../src/components/field-documentation.tsx"],"sourcesContent":["import { GraphQLArgument } from 'graphql';\nimport { useState } from 'react';\
|
|
1
|
+
{"version":3,"file":"field-documentation.js","sources":["../../src/components/field-documentation.tsx"],"sourcesContent":["import { GraphQLArgument } from 'graphql';\nimport { FC, useState } from 'react';\nimport { Button, MarkdownContent } from '@graphiql/react';\nimport { ExplorerFieldDef } from '../context';\nimport { Argument } from './argument';\nimport { DeprecationReason } from './deprecation-reason';\nimport { Directive } from './directive';\nimport { ExplorerSection } from './section';\nimport { TypeLink } from './type-link';\n\ntype FieldDocumentationProps = {\n /**\n * The field or argument that should be rendered.\n */\n field: ExplorerFieldDef;\n};\n\nexport const FieldDocumentation: FC<FieldDocumentationProps> = ({ field }) => {\n return (\n <>\n {field.description ? (\n <MarkdownContent type=\"description\">\n {field.description}\n </MarkdownContent>\n ) : null}\n <DeprecationReason preview={false}>\n {field.deprecationReason}\n </DeprecationReason>\n <ExplorerSection title=\"Type\">\n <TypeLink type={field.type} />\n </ExplorerSection>\n <Arguments field={field} />\n <Directives field={field} />\n </>\n );\n};\n\nconst Arguments: FC<{ field: ExplorerFieldDef }> = ({ field }) => {\n const [showDeprecated, setShowDeprecated] = useState(false);\n const handleShowDeprecated = () => {\n setShowDeprecated(true);\n };\n\n if (!('args' in field)) {\n return null;\n }\n\n const args: GraphQLArgument[] = [];\n const deprecatedArgs: GraphQLArgument[] = [];\n for (const argument of field.args) {\n if (argument.deprecationReason) {\n deprecatedArgs.push(argument);\n } else {\n args.push(argument);\n }\n }\n\n return (\n <>\n {args.length > 0 ? (\n <ExplorerSection title=\"Arguments\">\n {args.map(arg => (\n <Argument key={arg.name} arg={arg} />\n ))}\n </ExplorerSection>\n ) : null}\n {deprecatedArgs.length > 0 ? (\n showDeprecated || args.length === 0 ? (\n <ExplorerSection title=\"Deprecated Arguments\">\n {deprecatedArgs.map(arg => (\n <Argument key={arg.name} arg={arg} />\n ))}\n </ExplorerSection>\n ) : (\n <Button type=\"button\" onClick={handleShowDeprecated}>\n Show Deprecated Arguments\n </Button>\n )\n ) : null}\n </>\n );\n};\n\nconst Directives: FC<{ field: ExplorerFieldDef }> = ({ field }) => {\n const directives = field.astNode?.directives;\n if (!directives?.length) {\n return null;\n }\n return (\n <ExplorerSection title=\"Directives\">\n {directives.map(directive => (\n <div key={directive.name.value}>\n <Directive directive={directive} />\n </div>\n ))}\n </ExplorerSection>\n );\n};\n"],"names":["FieldDocumentation","t0","$","_c","field","t1","description","t2","deprecationReason","t3","type","t4","t5","t6","Arguments","showDeprecated","setShowDeprecated","useState","Symbol","for","handleShowDeprecated","args","deprecatedArgs","argument","push","length","map","_temp","_temp2","Directives","directives","astNode","_temp3","arg","name","arg_0","directive","value"],"mappings":";;;;;;;;;AAiBO,MAAMA,qBAAkDC,CAAA,OAAA;AAAAC,QAAAA,IAAAC,EAAA,EAAA;AAAC,QAAA;AAAA,IAAAC;AAAAA,EAAAA,IAAAH;AAASI,MAAAA;AAAA,MAAAH,EAAA,CAAA,MAAAE,MAAAE,aAAA;AAGlEF,SAAAA,MAAKE,cACH,oBAAA,iBAAA,EAAqB,MAAA,eACnBF,UAAAA,MAAKE,aACR,IACM;AAAA,MAAA,CAAA,IAAAF,MAAAE;AAAA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,KAAA;AAAA,SAyBtC,oBAAA,UAAA,EAA6BA,IAAfA,GAAAA,IAAGC,IAAmB;AAAA;AAzBE,SAAAN,OAAAO,OAAA;AAAA,SAiCpC,oBAAA,UAAA,EAA6BF,KAAAA,MAAAA,GAAfA,MAAGC,IAAmB;AAAA;AAaC,SAAAF,OAAAI,WAAA;AAQ5C,SAAA,oBAAA,SACE,UAAC,oBAAA,WAAA,EAAqBA,UACxB,CAAA,EAFUA,GAAAA,UAASF,KAAAG,KAEnB;AAAM;"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
1
2
|
import { ExplorerFieldDef } from '../context';
|
|
2
3
|
declare type FieldLinkProps = {
|
|
3
4
|
/**
|
|
@@ -5,5 +6,5 @@ declare type FieldLinkProps = {
|
|
|
5
6
|
*/
|
|
6
7
|
field: ExplorerFieldDef;
|
|
7
8
|
};
|
|
8
|
-
export declare
|
|
9
|
+
export declare const FieldLink: FC<FieldLinkProps>;
|
|
9
10
|
export {};
|
|
@@ -2,46 +2,49 @@ import { jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { c } from "react-compiler-runtime";
|
|
3
3
|
import { useExplorerContext } from "../context.js";
|
|
4
4
|
/* empty css */
|
|
5
|
-
|
|
5
|
+
const FieldLink = (t0) => {
|
|
6
6
|
const $ = c(7);
|
|
7
|
-
|
|
7
|
+
const {
|
|
8
|
+
field
|
|
9
|
+
} = t0;
|
|
10
|
+
let t1;
|
|
8
11
|
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
9
|
-
|
|
12
|
+
t1 = {
|
|
10
13
|
nonNull: true
|
|
11
14
|
};
|
|
12
|
-
$[0] =
|
|
15
|
+
$[0] = t1;
|
|
13
16
|
} else {
|
|
14
|
-
|
|
17
|
+
t1 = $[0];
|
|
15
18
|
}
|
|
16
19
|
const {
|
|
17
20
|
push
|
|
18
|
-
} = useExplorerContext(
|
|
19
|
-
let
|
|
20
|
-
if ($[1] !==
|
|
21
|
-
|
|
21
|
+
} = useExplorerContext(t1);
|
|
22
|
+
let t2;
|
|
23
|
+
if ($[1] !== field || $[2] !== push) {
|
|
24
|
+
t2 = (event) => {
|
|
22
25
|
event.preventDefault();
|
|
23
26
|
push({
|
|
24
|
-
name:
|
|
25
|
-
def:
|
|
27
|
+
name: field.name,
|
|
28
|
+
def: field
|
|
26
29
|
});
|
|
27
30
|
};
|
|
28
|
-
$[1] =
|
|
31
|
+
$[1] = field;
|
|
29
32
|
$[2] = push;
|
|
30
|
-
$[3] =
|
|
33
|
+
$[3] = t2;
|
|
31
34
|
} else {
|
|
32
|
-
|
|
35
|
+
t2 = $[3];
|
|
33
36
|
}
|
|
34
|
-
let
|
|
35
|
-
if ($[4] !==
|
|
36
|
-
|
|
37
|
-
$[4] =
|
|
38
|
-
$[5] =
|
|
39
|
-
$[6] =
|
|
37
|
+
let t3;
|
|
38
|
+
if ($[4] !== field.name || $[5] !== t2) {
|
|
39
|
+
t3 = /* @__PURE__ */ jsx("a", { className: "graphiql-doc-explorer-field-name", onClick: t2, href: "#", children: field.name });
|
|
40
|
+
$[4] = field.name;
|
|
41
|
+
$[5] = t2;
|
|
42
|
+
$[6] = t3;
|
|
40
43
|
} else {
|
|
41
|
-
|
|
44
|
+
t3 = $[6];
|
|
42
45
|
}
|
|
43
|
-
return
|
|
44
|
-
}
|
|
46
|
+
return t3;
|
|
47
|
+
};
|
|
45
48
|
export {
|
|
46
49
|
FieldLink
|
|
47
50
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"field-link.js","sources":["../../src/components/field-link.tsx"],"sourcesContent":["import { ExplorerFieldDef, useExplorerContext } from '../context';\
|
|
1
|
+
{"version":3,"file":"field-link.js","sources":["../../src/components/field-link.tsx"],"sourcesContent":["import { FC } from 'react';\nimport { ExplorerFieldDef, useExplorerContext } from '../context';\nimport './field-link.css';\n\ntype FieldLinkProps = {\n /**\n * The field or argument that should be linked to.\n */\n field: ExplorerFieldDef;\n};\n\nexport const FieldLink: FC<FieldLinkProps> = ({ field }) => {\n const { push } = useExplorerContext({ nonNull: true });\n\n return (\n <a\n className=\"graphiql-doc-explorer-field-name\"\n onClick={event => {\n event.preventDefault();\n push({ name: field.name, def: field });\n }}\n href=\"#\"\n >\n {field.name}\n </a>\n );\n};\n"],"names":["FieldLink","t0","$","_c","field","t1","Symbol","for","nonNull","push","useExplorerContext","t2","event","preventDefault","name","def","t3"],"mappings":";;;;AAWO,MAAMA,YAAgCC,CAAA,OAAA;AAAAC,QAAAA,IAAAC,EAAA,CAAA;AAAC,QAAA;AAAA,IAAAC;AAAAA,EAAAA,IAAAH;AAASI,MAAAA;AAAA,MAAAH,EAAA,CAAA,MAAAI,OAAAC,IAAA,2BAAA,GAAA;AACjB,SAAA;AAAA,MAAAC,SAAA;AAAA,IAAA;AAAiBN,WAAAG;AAAAA,EAAAA,OAAA;AAAAA,SAAAH,EAAA,CAAA;AAAA,EAAA;AAArD,QAAA;AAAA,IAAAO;AAAAA,EAAAA,IAAiBC,mBAAmBL,EAAiB;AAAEM,MAAAA;AAAA,MAAAT,EAAAE,CAAAA,MAAAA,SAAAF,SAAAO,MAAA;AAK1CE,SAAAC,CAAA,UAAA;AACPA,YAAKC,eAAgB;AACjB,WAAA;AAAA,QAAAC,MAASV,MAAKU;AAAAA,QAAAC,KAAYX;AAAAA,MAAAA,CAAO;AAAA,IAAC;AACvCF,WAAAE;AAAAF,WAAAO;AAAAP,WAAAS;AAAAA,EAAAA,OAAA;AAAAA,SAAAT,EAAA,CAAA;AAAA,EAAA;AAAAc,MAAAA;AAAAd,MAAAA,SAAAE,MAAAU,QAAAZ,SAAAS,IAAA;AALH,SAAA,oBAAA,OACY,WAAA,oCACD,SAAAA,IAIJ,MAAA,KAEJP,UAAAA,MAAKU,KACR,CAAA;AAAI,MAAA,CAAA,IAAAV,MAAAU;AAAAZ,WAAAS;AAAAT,WAAAc;AAAAA,EAAAA,OAAA;AAAAA,SAAAd,EAAA,CAAA;AAAA,EAAA;AATJc,SAAAA;AASI;"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
1
2
|
import { GraphQLSchema } from 'graphql';
|
|
2
3
|
declare type SchemaDocumentationProps = {
|
|
3
4
|
/**
|
|
@@ -5,5 +6,5 @@ declare type SchemaDocumentationProps = {
|
|
|
5
6
|
*/
|
|
6
7
|
schema: GraphQLSchema;
|
|
7
8
|
};
|
|
8
|
-
export declare
|
|
9
|
+
export declare const SchemaDocumentation: FC<SchemaDocumentationProps>;
|
|
9
10
|
export {};
|