Skip to content

Commit 183bc7c

Browse files
committed
Regen
1 parent 64aa960 commit 183bc7c

File tree

2 files changed

+33
-19
lines changed

2 files changed

+33
-19
lines changed

juniper/Makefile

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,26 +41,23 @@ graphiql:
4141
$(eval graphiql-react-ver := $(strip \
4242
$(shell curl -fsL https://raw.githubusercontent.com/graphql/graphiql/refs/tags/graphiql%40$(GRAPHIQL_VER)/packages/graphiql/package.json \
4343
| grep -m1 '"@graphiql/react": "' | cut -d '"' -f4 | cut -d '^' -f2)))
44-
$(eval graphiql-toolkit-ver := $(strip \
45-
$(shell curl -fsL https://raw.githubusercontent.com/graphql/graphiql/refs/tags/graphiql%40$(GRAPHIQL_VER)/packages/graphiql/package.json \
46-
| grep -m1 '"@graphiql/toolkit": "' | cut -d '"' -f4 | cut -d '^' -f2)))
4744
curl -fsL -o src/http/graphiql.html \
4845
https://raw.githubusercontent.com/graphql/graphiql/graphiql%40$(GRAPHIQL_VER)/examples/graphiql-cdn/index.html
49-
$(sed-i) 's|esm.sh/graphiql@4.0.0|esm.sh/graphiql@$(GRAPHIQL_VER)|g' \
46+
$(sed-i) 's|esm.sh/graphiql@5.0.0-rc.1|esm.sh/graphiql@$(GRAPHIQL_VER)|g' \
5047
src/http/graphiql.html
51-
$(sed-i) 's|esm.sh/@graphiql/plugin-explorer@4.0.0|esm.sh/@graphiql/plugin-explorer@$(graphiql-plugin-explorer-ver)|g' \
48+
$(sed-i) 's|esm.sh/graphiql@6.0.0-canary-b26dcda1.0|esm.sh/graphiql@$(GRAPHIQL_VER)|g' \
5249
src/http/graphiql.html
53-
$(sed-i) 's|esm.sh/@graphiql/[email protected]|esm.sh/@graphiql/react@$(graphiql-react-ver)|g' \
50+
$(sed-i) 's|esm.sh/@graphiql/[email protected]|esm.sh/@graphiql/plugin-explorer@$(graphiql-plugin-explorer-ver)|g' \
5451
src/http/graphiql.html
55-
$(sed-i) 's|esm.sh/@graphiql/toolkit@0.11.2|esm.sh/@graphiql/toolkit@$(graphiql-toolkit-ver)|g' \
52+
$(sed-i) 's|esm.sh/@graphiql/react@0.36.0-canary-b26dcda1.0|esm.sh/@graphiql/react@$(graphiql-react-ver)|g' \
5653
src/http/graphiql.html
5754
$(sed-i) "s|'https://countries.trevorblades.com'|JUNIPER_URL|g" \
5855
src/http/graphiql.html
5956
$(sed-i) 's|url: JUNIPER_URL,|url: JUNIPER_URL,\n subscriptionUrl: normalizeSubscriptionEndpoint(JUNIPER_URL, JUNIPER_SUBSCRIPTIONS_URL)|' \
6057
src/http/graphiql.html
6158
$(sed-i) 's|<script type="module">|<script type="module">\n<!-- inject -->|' \
6259
src/http/graphiql.html
63-
$(sed-i) 's|GraphiQL 4 with React 19 and GraphiQL Explorer|GraphiQL|' \
60+
$(sed-i) 's|GraphiQL 5 with React 19 and GraphiQL Explorer|GraphiQL|' \
6461
src/http/graphiql.html
6562

6663

juniper/src/http/graphiql.html

Lines changed: 28 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
* Copyright (c) 2021 GraphQL Contributors
2+
* Copyright (c) 2025 GraphQL Contributors
33
* All rights reserved.
44
*
55
* This source code is licensed under the license found in the
@@ -14,7 +14,6 @@
1414
<style>
1515
body {
1616
margin: 0;
17-
overflow: hidden; /* in Firefox */
1817
}
1918

2019
#graphiql {
@@ -31,11 +30,11 @@
3130
</style>
3231
<link
3332
rel="stylesheet"
34-
href="https://esm.sh/graphiql@4.1.2/dist/style.css"
33+
href="https://esm.sh/graphiql@5.0.0/dist/style.css"
3534
/>
3635
<link
3736
rel="stylesheet"
38-
href="https://esm.sh/@graphiql/plugin-explorer@4.0.6/dist/style.css"
37+
href="https://esm.sh/@graphiql/plugin-explorer@5.0.0/dist/style.css"
3938
/>
4039
<!-- Note: the ?standalone flag bundles the module along with all of its `dependencies`, excluding `peerDependencies`, into a single JavaScript file. -->
4140
<script type="importmap">
@@ -47,11 +46,11 @@
4746
"react-dom": "https://esm.sh/[email protected]",
4847
"react-dom/client": "https://esm.sh/[email protected]/client",
4948

50-
"graphiql": "https://esm.sh/graphiql@4.1.2?standalone&external=react,react/jsx-runtime,react-dom,@graphiql/react",
51-
"@graphiql/plugin-explorer": "https://esm.sh/@graphiql/plugin-explorer@4.0.6?standalone&external=react,react/jsx-runtime,react-dom,@graphiql/react,graphql",
52-
"@graphiql/react": "https://esm.sh/@graphiql/react@0.34.1?standalone&external=react,react/jsx-runtime,react-dom,graphql,@graphiql/toolkit",
49+
"graphiql": "https://esm.sh/graphiql@5.0.0?standalone&external=react,react-dom,@graphiql/react,graphql",
50+
"@graphiql/plugin-explorer": "https://esm.sh/@graphiql/plugin-explorer@5.0.0?standalone&external=react,@graphiql/react,graphql",
51+
"@graphiql/react": "https://esm.sh/@graphiql/react@0.35.0?standalone&external=react,react-dom,graphql",
5352

54-
"@graphiql/toolkit": "https://esm.sh/@graphiql/toolkit@0.11.3?standalone&external=graphql",
53+
"@graphiql/toolkit": "https://esm.sh/@graphiql/toolkit?standalone&external=graphql",
5554
"graphql": "https://esm.sh/[email protected]"
5655
}
5756
}
@@ -62,20 +61,38 @@
6261
import React from 'react';
6362
import ReactDOM from 'react-dom/client';
6463
// Import GraphiQL and the Explorer plugin
65-
import { GraphiQL } from 'graphiql';
64+
import { GraphiQL, HISTORY_PLUGIN } from 'graphiql';
6665
import { createGraphiQLFetcher } from '@graphiql/toolkit';
6766
import { explorerPlugin } from '@graphiql/plugin-explorer';
6867

68+
import createJSONWorker from 'https://esm.sh/monaco-editor/esm/vs/language/json/json.worker.js?worker';
69+
import createGraphQLWorker from 'https://esm.sh/monaco-graphql/esm/graphql.worker.js?worker';
70+
import createEditorWorker from 'https://esm.sh/monaco-editor/esm/vs/editor/editor.worker.js?worker';
71+
72+
globalThis.MonacoEnvironment = {
73+
getWorker(_workerId, label) {
74+
console.info('MonacoEnvironment.getWorker', { label });
75+
switch (label) {
76+
case 'json':
77+
return createJSONWorker();
78+
case 'graphql':
79+
return createGraphQLWorker();
80+
}
81+
return createEditorWorker();
82+
},
83+
};
84+
6985
const fetcher = createGraphiQLFetcher({
7086
url: JUNIPER_URL,
7187
subscriptionUrl: normalizeSubscriptionEndpoint(JUNIPER_URL, JUNIPER_SUBSCRIPTIONS_URL)
7288
});
73-
const explorer = explorerPlugin();
89+
const plugins = [HISTORY_PLUGIN, explorerPlugin()];
7490

7591
function App() {
7692
return React.createElement(GraphiQL, {
7793
fetcher,
78-
plugins: [explorer],
94+
plugins,
95+
defaultEditorToolsVisibility: true,
7996
});
8097
}
8198

0 commit comments

Comments
 (0)