| 1 |
<!DOCTYPE html> |
| 2 |
<html lang="en"> |
| 3 |
<head> |
| 4 |
<title>GraphiQL</title> |
| 5 |
<style> |
| 6 |
body { |
| 7 |
margin: 0; |
| 8 |
} |
| 9 |
#graphiql { |
| 10 |
height: 100vh; |
| 11 |
} |
| 12 |
.loading { |
| 13 |
height: 100%; |
| 14 |
display: flex; |
| 15 |
align-items: center; |
| 16 |
justify-content: center; |
| 17 |
font-size: 3rem; |
| 18 |
} |
| 19 |
</style> |
| 20 |
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/style.css" integrity="sha256-VJJlSPT99+ooC+9T89qxILPcv0UHNKuE31LhrdQXHKg=" crossorigin="anonymous" /> |
| 21 |
</head> |
| 22 |
<body> |
| 23 |
<div id="graphiql"><div class="loading">Loading...</div></div> |
| 24 |
<script type="importmap"> |
| 25 |
{ |
| 26 |
"imports": { |
| 27 |
"react": "https://esm.sh/stable/[email protected]/esnext/react.mjs", |
| 28 |
"react-dom/client": "https://esm.sh/v1/[email protected]/esnext/client.js", |
| 29 |
"graphiql": "https://esm.sh/v1/[email protected]/esnext/graphiql.bundle.mjs", |
| 30 |
"@graphiql/toolkit": "https://esm.sh/v1/@graphiql/[email protected]/esnext/toolkit.bundle.mjs" |
| 31 |
}, |
| 32 |
"integrity": { |
| 33 |
"https://esm.sh/stable/[email protected]/esnext/react.mjs": "sha384-ICxl5p37EghGSeJgwcxxHLX5PG1XW5heC5Ilv1kOL+T7k0tFqG/ntLecPHco9x+o", |
| 34 |
"https://esm.sh/v1/[email protected]/esnext/client.js": "sha384-ihw3poHawapRYf68dcmx6Fz4MSOLYsFIjLsnKChdL1bELCTG9yqLNM/opcKlb4iN", |
| 35 |
"https://esm.sh/v1/[email protected]/esnext/graphiql.bundle.mjs": "sha384-5DPC8bLw40v5OYL1AWTCxr1fcDR8Une9NsZo4SnYq0pI6uNAWKoSijaivuWoIUWk", |
| 36 |
"https://esm.sh/v1/@graphiql/[email protected]/esnext/toolkit.bundle.mjs": "sha384-QjXPUcfiQg1LmHrMD1WtTxFnyvyhiSW+R/wY+yk42MqMqYgDOVUs2rLqwi+BHWBC" |
| 37 |
} |
| 38 |
} |
| 39 |
</script> |
| 40 |
<script type="module"> |
| 41 |
import React from 'react'; |
| 42 |
import {createRoot} from 'react-dom/client'; |
| 43 |
import {GraphiQL} from 'graphiql'; |
| 44 |
import {createGraphiQLFetcher} from '@graphiql/toolkit'; |
| 45 |
|
| 46 |
const root = createRoot(document.getElementById('graphiql')); |
| 47 |
root.render( |
| 48 |
React.createElement(GraphiQL, { |
| 49 |
fetcher: createGraphiQLFetcher({url: '/query'}), |
| 50 |
defaultEditorToolsVisibility: true, |
| 51 |
}), |
| 52 |
); |
| 53 |
</script> |
| 54 |
</body> |
| 55 |
</html> |