UNPKG

967 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.renderGraphiQL = void 0;
4const graphiql_js_1 = require("./graphiql.js");
5const renderGraphiQL = (opts) => /* HTML */ `
6 <!DOCTYPE html>
7 <html lang="en">
8 <head>
9 <meta charset="utf-8" />
10 <title>${opts?.title || 'Yoga GraphiQL'}</title>
11 <link
12 rel="icon"
13 href="https://raw.githubusercontent.com/dotansimha/graphql-yoga/v3/website/public/favicon.ico"
14 />
15 <style>
16 ${graphiql_js_1.css}
17 </style>
18 </head>
19 <body id="body" class="no-focus-outline">
20 <noscript>You need to enable JavaScript to run this app.</noscript>
21 <div id="root"></div>
22
23 <script>
24 ${graphiql_js_1.js}
25 YogaGraphiQL.renderYogaGraphiQL(
26 window.document.querySelector('#root'),
27 ${JSON.stringify(opts ?? {})},
28 )
29 </script>
30 </body>
31 </html>
32`;
33exports.renderGraphiQL = renderGraphiQL;