[FA-misc] Astro migration works, probably want to touchup the frontend but that can be in Phase 4

This commit is contained in:
gamer147
2025-11-28 10:43:51 -05:00
parent bc83bffb4b
commit 8d6f0d6cfd
94 changed files with 11948 additions and 9202 deletions

View File

@@ -0,0 +1,21 @@
import { Client, cacheExchange, fetchExchange } from '@urql/core';
import { get } from 'svelte/store';
import { user } from '../auth/authStore';
export function createClient() {
return new Client({
url: import.meta.env.PUBLIC_GRAPHQL_URI,
exchanges: [cacheExchange, fetchExchange],
fetchOptions: () => {
const currentUser = get(user);
return {
headers: currentUser?.access_token
? { Authorization: `Bearer ${currentUser.access_token}` }
: {},
};
},
});
}
// Singleton for use in components
export const client = createClient();