]>
git.r.bdr.sh - rbdr/forum/blob - src/stores/forums.js
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
,