|
1 | 1 | import { TypedDocumentNode } from "@apollo/client/core";
|
2 | 2 | import { GetLabels, GetProjectColumns } from "../queries/label-columns-queries";
|
3 |
| -import { createCache } from "../ttl-cache"; |
4 | 3 | import { client } from "../graphql-client";
|
5 | 4 | import { noNullish } from "./util";
|
6 | 5 |
|
7 |
| -const cache = createCache(); |
8 |
| - |
9 | 6 | export async function getProjectBoardColumns() {
|
10 |
| - return cache.getAsync("project board colum names", Infinity, async () => { |
11 |
| - const res = noNullish((await query(GetProjectColumns)) |
12 |
| - .repository?.project?.columns.nodes); |
13 |
| - return res.sort((a,b) => a.name.localeCompare(b.name)); |
14 |
| - }); |
| 7 | + const res = noNullish((await query(GetProjectColumns)) |
| 8 | + .repository?.project?.columns.nodes); |
| 9 | + return res.sort((a,b) => a.name.localeCompare(b.name)); |
15 | 10 | }
|
16 | 11 |
|
17 | 12 | export async function getLabels() {
|
18 |
| - return await cache.getAsync("label ids", Infinity, async () => { |
19 |
| - const res = noNullish((await query(GetLabels)) |
20 |
| - .repository?.labels?.nodes); |
21 |
| - return res.sort((a,b) => a.name.localeCompare(b.name)); |
22 |
| - }); |
| 13 | + const res = noNullish((await query(GetLabels)) |
| 14 | + .repository?.labels?.nodes); |
| 15 | + return res.sort((a,b) => a.name.localeCompare(b.name)); |
23 | 16 | }
|
24 | 17 |
|
25 | 18 | async function query<T>(gql: TypedDocumentNode<T>): Promise<T> {
|
26 | 19 | const res = await client.query({
|
27 | 20 | query: gql,
|
28 |
| - fetchPolicy: "network-only", |
29 | 21 | });
|
30 | 22 | return res.data;
|
31 | 23 | }
|
0 commit comments