Files
Suwayomi-Server/server/src/main/resources/graphql-playground.html
schroda 890920a57b Freeze graphql playground scripts to working versions (#585)
The latest versions might include breaking changes
2023-07-01 21:17:41 +03:30

120 lines
3.7 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<title>GraphiQL</title>
<style>
body {
height: 100%;
margin: 0;
width: 100%;
overflow: hidden;
}
#graphiql {
height: 100vh;
}
</style>
<!--
This GraphiQL example depends on Promise and fetch, which are available in
modern browsers, but can be "polyfilled" for older browsers.
GraphiQL itself depends on React DOM.
If you do not want to rely on a CDN, you can host these files locally or
include them directly in your favored resource bundler.
-->
<script
crossorigin="anonymous"
integrity="sha512-Vf2xGDzpqUOEIKO+X2rgTLWPY+65++WPwCHkX2nFMu9IcstumPsf/uKKRd5prX3wOu8Q0GBylRpsDB26R6ExOg=="
src="https://unpkg.com/react@17.0.2/umd/react.development.js"
></script>
<script
crossorigin="anonymous"
integrity="sha512-Wr9OKCTtq1anK0hq5bY3X/AvDI5EflDSAh0mE9gma+4hl+kXdTJPKZ3TwLMBcrgUeoY0s3dq9JjhCQc7vddtFg=="
src="https://unpkg.com/react-dom@17.0.2/umd/react-dom.development.js"
></script>
<!--
These two files can be found in the npm module, however you may wish to
copy them directly into your environment, or perhaps include them in your
favored resource bundler.
-->
<link href="https://unpkg.com/graphiql@3.0.0/graphiql.min.css" rel="stylesheet"/>
<link href="https://unpkg.com/@graphiql/plugin-explorer@0.1.22/dist/style.css" rel="stylesheet"/>
<style>
.docExplorerWrap {
width: 100% !important;
padding-bottom: 20px;
}
.docExplorerHide {
display: none;
}
/*noinspection CssUnresolvedCustomProperty*/
.doc-explorer-title {
font-weight: var(--font-weight-medium);
font-size: var(--font-size-h2);
overflow-x: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.doc-explorer-contents {
height: 100%;
padding-bottom: 40px;
}
.graphiql-explorer-root {
padding-bottom: 40px;
}
</style>
</head>
<body>
<div id="graphiql">Loading...</div>
<script
src="https://unpkg.com/graphiql@3.0.0/graphiql.min.js"
type="application/javascript"
></script>
<script
src="https://unpkg.com/@graphiql/plugin-explorer@0.1.22/dist/graphiql-plugin-explorer.umd.js"
type="application/javascript"
></script>
<script>
const fetcher = GraphiQL.createFetcher({
url: window.location.href,
});
function GraphiQLWithExplorer() {
const [query, setQuery] = React.useState(
'query AllCategories {\n' +
' categories {\n' +
' nodes {\n' +
' mangas {\n' +
' nodes {\n' +
' title\n' +
' }\n' +
' }\n' +
' }\n' +
' }\n' +
'}',
);
const explorerPlugin = GraphiQLPluginExplorer.useExplorerPlugin({
query: query,
onEdit: setQuery,
});
return React.createElement(GraphiQL, {
fetcher: fetcher,
defaultEditorToolsVisibility: true,
plugins: [explorerPlugin],
query: query,
onEditQuery: setQuery,
});
}
ReactDOM.render(
React.createElement(GraphiQLWithExplorer),
document.getElementById('graphiql'),
);
</script>
</body>
</html>