aboutsummaryrefslogtreecommitdiff
path: root/source/standalone
diff options
context:
space:
mode:
Diffstat (limited to 'source/standalone')
-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
+};