]>
git.r.bdr.sh - rbdr/forum/blob - src/stores/forums.js
ade01a7110e76ed0fa2c14d30e19ca7ba22d16e1
1 import { ApolloError
} from '@apollo/client/core';
2 import { readable
} from 'svelte/store';
3 import { client
} from '$config/apollo';
4 import { GET_FORUMS
} from '$data/queries';
8 // The exported data structure
17 export const forums
= readable(internals
.initialValue
, (set) => {
19 client
.watchQuery({ query: GET_FORUMS
}).subscribe((result
) => {
22 const error
= new ApolloError({ graphQLErrors: result
.errors
});
32 data: result
.data
.forums
,