()
| 105 | // so surfaces holding nothing but raw tag values share one lookup of the whole |
| 106 | // directory. Callers fall back to the raw value, never to an invented casing. |
| 107 | export const tagTitlesQueryOptions = () => ({ |
| 108 | queryKey: generateQueryKey(RequestKey.TagTitles), |
| 109 | queryFn: async (): Promise<Record<string, string>> => { |
| 110 | const { tags } = await gqlClient.request<{ tags: Keyword[] }>( |
| 111 | TAG_TITLES_QUERY, |
| 112 | ); |
| 113 | |
| 114 | return Object.fromEntries( |
| 115 | tags.flatMap(({ value, flags }) => |
| 116 | flags?.title ? [[value, flags.title]] : [], |
| 117 | ), |
| 118 | ); |
| 119 | }, |
| 120 | staleTime: StaleTime.OneDay, |
| 121 | }); |
| 122 | |
| 123 | export const TAG_DIRECTORY_QUERY = gql` |
| 124 | query TagDirectory { |
no test coverage detected