MCPcopy Create free account
hub / github.com/dailydotdev/apps / tagTitlesQueryOptions

Function tagTitlesQueryOptions

packages/shared/src/graphql/keywords.ts:107–121  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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.
107export 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
123export const TAG_DIRECTORY_QUERY = gql`
124 query TagDirectory {

Callers 5

BookmarkFoldersStripFunction · 0.90
PostTopicSignupFunction · 0.90
TagPageNavbarFunction · 0.90
ReadingTagsSectionFunction · 0.90

Calls 1

generateQueryKeyFunction · 0.90

Tested by

no test coverage detected