aboutsummaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authornetop://ウィビ <paul@webb.page>2026-04-26 20:51:04 -0700
committernetop://ウィビ <paul@webb.page>2026-04-26 20:51:04 -0700
commit07d39a1a3a09739bbc3d27a31829063f1e0a5e24 (patch)
treeac5a6e2878da4546dd71eda1ba720cb798bb0d26 /source
parent938496228e9553c90aa81ee993c0d760a7dd6c26 (diff)
downloadgraphiql-07d39a1a3a09739bbc3d27a31829063f1e0a5e24.tar.gz
graphiql-07d39a1a3a09739bbc3d27a31829063f1e0a5e24.zip
adds standalone version for CDN ease
Diffstat (limited to 'source')
-rw-r--r--source/standalone/index.ts41
1 files changed, 41 insertions, 0 deletions
diff --git a/source/standalone/index.ts b/source/standalone/index.ts
new file mode 100644
index 0000000..f6defca
--- /dev/null
+++ b/source/standalone/index.ts
@@ -0,0 +1,41 @@
+
+
+
+/*** IMPORT ------------------------------------------- ***/
+
+import {
+ mount as svelteMount,
+ unmount as svelteUnmount,
+ type ComponentProps
+} from "svelte";
+
+/*** UTILITY ------------------------------------------ ***/
+
+import GraphiQL from "../library/GraphiQL.svelte";
+
+import { createApqFetcher } from "../library/fetcher/apq.ts";
+import { createHttpFetcher } from "../library/fetcher/http.ts";
+import { createSseFetcher } from "../library/fetcher/sse.ts";
+import { createWsFetcher } from "../library/fetcher/websocket.ts";
+import { lightTheme } from "../library/themes/light.ts";
+
+type Props = ComponentProps<typeof GraphiQL>;
+type Instance = Record<string, unknown>;
+
+/*** EXPORT ------------------------------------------- ***/
+
+export function mount(target: HTMLElement, props: Props): Instance {
+ return svelteMount(GraphiQL, { props, target });
+}
+
+export function unmount(instance: Instance): void {
+ svelteUnmount(instance);
+}
+
+export {
+ createApqFetcher,
+ createHttpFetcher,
+ createSseFetcher,
+ createWsFetcher,
+ lightTheme
+};