MCPcopy Create free account
hub / github.com/coder/coder / seedInfiniteChats

Function seedInfiniteChats

site/src/api/queries/chats.test.ts:88–97  ·  view source on GitHub ↗
(
	queryClient: QueryClient,
	chats: TypesGen.Chat[],
	opts?: InfiniteChatsTestOptions,
)

Source from the content-addressed store, hash-verified

86
87/** Seed the infinite chats cache in the format TanStack Query expects. */
88const seedInfiniteChats = (
89 queryClient: QueryClient,
90 chats: TypesGen.Chat[],
91 opts?: InfiniteChatsTestOptions,
92) => {
93 queryClient.setQueryData<InfiniteData>(infiniteChatsKey(opts), {
94 pages: [chats],
95 pageParams: [0],
96 });
97};
98
99/** Read chats back from the infinite query cache. */
100const readInfiniteChats = (

Callers 1

chats.test.tsFile · 0.70

Calls 1

infiniteChatsKeyFunction · 0.90

Tested by

no test coverage detected