aboutsummaryrefslogtreecommitdiff
path: root/src/lib/stores/forums.ts
blob: 8a395b329d2c29df02b9c4dec704c4adccf5374f (plain)
1
2
3
4
5
6
7
8
9
import { store } from './apollo';
import { GET_FORUM, GET_FORUMS } from '$lib/data/queries';

import type { Forum } from '$lib/data/types';

export const getForum = (id: string) =>
	store<Forum>({ key: 'forum', query: GET_FORUM, variables: { id } });
export const getForums = () =>
	store<Forum[]>({ key: 'forums', query: GET_FORUMS, initialValue: [] });