added in graphql client
This commit is contained in:
8
web/lib/client.ts
Normal file
8
web/lib/client.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
import { Client, cacheExchange, fetchExchange } from '@urql/svelte';
|
||||
|
||||
export function newClient(url: string) {
|
||||
return new Client({
|
||||
url,
|
||||
exchanges: [cacheExchange, fetchExchange]
|
||||
});
|
||||
}
|
@@ -1,5 +0,0 @@
|
||||
import { HoudiniClient } from '$houdini';
|
||||
|
||||
export default new HoudiniClient({
|
||||
url: process.env.GRAPH_HOST
|
||||
});
|
@@ -1,3 +0,0 @@
|
||||
export function hello() {
|
||||
console.log("hello");
|
||||
}
|
0
web/lib/stores/alert.svelte.ts
Normal file
0
web/lib/stores/alert.svelte.ts
Normal file
1
web/lib/stores/auth.svelte.ts
Normal file
1
web/lib/stores/auth.svelte.ts
Normal file
@@ -0,0 +1 @@
|
||||
export let authUser = $state();
|
@@ -1,6 +1,10 @@
|
||||
<script>
|
||||
import "../app.css";
|
||||
const { children } = $props();
|
||||
<script lang="ts">
|
||||
import { setContextClient } from '@urql/svelte';
|
||||
import { newClient } from '$lib/client';
|
||||
import '../app.css';
|
||||
|
||||
const { children } = $props();
|
||||
setContextClient(newClient(import.meta.env.VITE_GRAPH_URL ?? ''));
|
||||
</script>
|
||||
|
||||
{@render children()}
|
||||
|
Reference in New Issue
Block a user