|
47 | 47 | </script> |
48 | 48 | <script type="module"> |
49 | 49 | // Import React and ReactDOM |
50 | | - import React from 'react'; |
51 | | - import ReactDOM from 'react-dom/client'; |
| 50 | + import React from "react"; |
| 51 | + import ReactDOM from "react-dom/client"; |
52 | 52 | // Import GraphiQL and the Explorer plugin |
53 | | - import { GraphiQL, HISTORY_PLUGIN } from 'graphiql'; |
54 | | - import { createGraphiQLFetcher } from '@graphiql/toolkit'; |
55 | | - import { explorerPlugin } from '@graphiql/plugin-explorer'; |
| 53 | + import { GraphiQL, HISTORY_PLUGIN } from "graphiql"; |
| 54 | + import { createGraphiQLFetcher } from "@graphiql/toolkit"; |
| 55 | + import { explorerPlugin } from "@graphiql/plugin-explorer"; |
56 | 56 |
|
57 | | - import createJSONWorker from 'https://esm.sh/monaco-editor/esm/vs/language/json/json.worker.js?worker'; |
58 | | - import createGraphQLWorker from 'https://esm.sh/monaco-graphql/esm/graphql.worker.js?worker'; |
59 | | - import createEditorWorker from 'https://esm.sh/monaco-editor/esm/vs/editor/editor.worker.js?worker'; |
| 57 | + import createJSONWorker from "https://esm.sh/monaco-editor/esm/vs/language/json/json.worker.js?worker"; |
| 58 | + import createGraphQLWorker from "https://esm.sh/monaco-graphql/esm/graphql.worker.js?worker"; |
| 59 | + import createEditorWorker from "https://esm.sh/monaco-editor/esm/vs/editor/editor.worker.js?worker"; |
60 | 60 |
|
61 | 61 | globalThis.MonacoEnvironment = { |
62 | 62 | getWorker(_workerId, label) { |
63 | | - console.info('MonacoEnvironment.getWorker', { label }); |
| 63 | + console.info("MonacoEnvironment.getWorker", { label }); |
64 | 64 | switch (label) { |
65 | | - case 'json': |
| 65 | + case "json": |
66 | 66 | return createJSONWorker(); |
67 | | - case 'graphql': |
| 67 | + case "graphql": |
68 | 68 | return createGraphQLWorker(); |
69 | 69 | } |
70 | 70 | return createEditorWorker(); |
71 | 71 | }, |
72 | 72 | }; |
73 | 73 |
|
74 | 74 | const fetcher = createGraphiQLFetcher({ |
75 | | - url: '/api' |
| 75 | + url: "/api", |
76 | 76 | }); |
77 | 77 | const plugins = [HISTORY_PLUGIN, explorerPlugin()]; |
78 | 78 |
|
|
84 | 84 | }); |
85 | 85 | } |
86 | 86 |
|
87 | | - const container = document.getElementById('graphiql'); |
| 87 | + const container = document.getElementById("graphiql"); |
88 | 88 | const root = ReactDOM.createRoot(container); |
89 | 89 | root.render(React.createElement(App)); |
90 | 90 | </script> |
|
0 commit comments