@graphql-yoga/render-graphiql
Version:
27 lines (25 loc) • 698 B
JavaScript
import { css, js, favicon } from './graphiql.js';
export const renderGraphiQL = (opts) => /* HTML */ `
<html lang="en">
<head>
<meta charset="utf-8" />
<title>${opts?.title || 'Yoga GraphiQL'}</title>
<link rel="icon" href="${favicon}" />
<style>
${css}
</style>
</head>
<body id="body" class="no-focus-outline">
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<script>
${js}
YogaGraphiQL.renderYogaGraphiQL(
window.document.querySelector('#root'),
${JSON.stringify(opts ?? {})},
)
</script>
</body>
</html>
`;