Skip to content

Commit e8782df

Browse files
JBodkin-Amphorabclozel
authored andcommitted
Upgrade to GraphiQL 5.2.1
Closes gh-1363 Signed-off-by: JBodkin-Amphora <james.bodkin+github@amphora.net>
1 parent 6ab0343 commit e8782df

File tree

1 file changed

+16
-29
lines changed
  • spring-graphql/src/main/resources/graphiql

1 file changed

+16
-29
lines changed

spring-graphql/src/main/resources/graphiql/index.html

Lines changed: 16 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,22 @@
1919
font-size: 4rem;
2020
}
2121
</style>
22-
<link rel="stylesheet" href="https://esm.sh/graphiql@5.0.0/dist/style.css"/>
23-
<link rel="stylesheet" href="https://esm.sh/@graphiql/plugin-explorer@5.0.0/dist/style.css"/>
22+
<link rel="stylesheet" href="https://esm.sh/graphiql@5.2.1/dist/style.css"/>
23+
<link rel="stylesheet" href="https://esm.sh/@graphiql/plugin-explorer@5.1.1/dist/style.css"/>
2424
<script type="importmap">
2525
{
2626
"imports": {
2727
"react": "https://esm.sh/react@19.1.0",
28-
"react/jsx-runtime": "https://esm.sh/react@19.1.0/jsx-runtime",
28+
"react/": "https://esm.sh/react@19.1.0/",
2929
"react-dom": "https://esm.sh/react-dom@19.1.0",
30-
"react-dom/client": "https://esm.sh/react-dom@19.1.0/client",
31-
"graphiql": "https://esm.sh/graphiql@5.0.0?standalone&external=react,react-dom,@graphiql/react,graphql",
32-
"@graphiql/plugin-explorer": "https://esm.sh/@graphiql/plugin-explorer@5.0.0?standalone&external=react,@graphiql/react,graphql",
33-
"@graphiql/react": "https://esm.sh/@graphiql/react@0.35.0?standalone&external=react,react-dom,graphql",
30+
"react-dom/": "https://esm.sh/react-dom@19.1.0/",
31+
"graphiql": "https://esm.sh/graphiql@5.2.1?standalone&external=react,react-dom,@graphiql/react,graphql",
32+
"graphiql/": "https://esm.sh/graphiql@5.2.1/",
33+
"@graphiql/plugin-explorer": "https://esm.sh/@graphiql/plugin-explorer@5.1.1?standalone&external=react,@graphiql/react,graphql",
34+
"@graphiql/react": "https://esm.sh/@graphiql/react@0.37.2?standalone&external=react,react-dom,graphql,@graphiql/toolkit,@emotion/is-prop-valid",
3435
"@graphiql/toolkit": "https://esm.sh/@graphiql/toolkit@0.11.3?standalone&external=graphql",
35-
"graphql": "https://esm.sh/graphql@16.11.0"
36+
"graphql": "https://esm.sh/graphql@16.11.0",
37+
"@emotion/is-prop-valid": "data:text/javascript,"
3638
}
3739
}
3840
</script>
@@ -42,33 +44,18 @@
4244
import { GraphiQL, HISTORY_PLUGIN } from 'graphiql';
4345
import { createGraphiQLFetcher } from '@graphiql/toolkit';
4446
import { explorerPlugin } from '@graphiql/plugin-explorer';
45-
46-
import createJSONWorker from 'https://esm.sh/monaco-editor/esm/vs/language/json/json.worker.js?worker';
47-
import createGraphQLWorker from 'https://esm.sh/monaco-graphql/esm/graphql.worker.js?worker';
48-
import createEditorWorker from 'https://esm.sh/monaco-editor/esm/vs/editor/editor.worker.js?worker';
49-
50-
globalThis.MonacoEnvironment = {
51-
getWorker(_workerId, label) {
52-
switch (label) {
53-
case 'json':
54-
return createJSONWorker();
55-
case 'graphql':
56-
return createGraphQLWorker();
57-
}
58-
return createEditorWorker();
59-
},
60-
};
47+
import 'graphiql/setup-workers/esm.sh';
6148

6249
const params = new URLSearchParams(window.location.search);
63-
const path = params.get("path") || "/graphql";
50+
const path = params.get('path') || '/graphql';
6451
const url = `${location.protocol}//${location.host}${path}`;
65-
const wsPath = params.get("wsPath") || "/graphql";
52+
const wsPath = params.get('wsPath') || '/graphql';
6653
const wsProtocol = location.protocol === 'https:' ? 'wss:' : 'ws:';
6754
const subscriptionUrl = `${wsProtocol}//${location.host}${wsPath}`;
6855
const gqlFetcher = createGraphiQLFetcher({'url': url, 'subscriptionUrl': subscriptionUrl});
6956
const plugins = [HISTORY_PLUGIN, explorerPlugin()];
7057
const xsrfToken = document.cookie.match(new RegExp('(?:^| )XSRF-TOKEN=([^;]+)'));
71-
const initialHeaders = xsrfToken ? `{ "X-XSRF-TOKEN" : "${ xsrfToken[1] }" }` : `{}`;
58+
const initialHeaders = xsrfToken ? `{ 'X-XSRF-TOKEN' : '${ xsrfToken[1] }' }` : undefined;
7259

7360
function App() {
7461
return React.createElement(GraphiQL, {
@@ -87,6 +74,6 @@
8774
</script>
8875
</head>
8976
<body>
90-
<div id="graphiql"><div class="loading">Loading...</div></div>
77+
<div id="graphiql"><div class="loading">Loading...</div></div>
9178
</body>
92-
</html>
79+
</html>

0 commit comments

Comments
 (0)