MCPcopy Create free account
hub / github.com/F12FLASH/CTF / getQueryFn

Function getQueryFn

4.Stackless Stack/client/src/lib/queryClient.ts:30–42  ·  view source on GitHub ↗
({ on401: unauthorizedBehavior })

Source from the content-addressed store, hash-verified

28 on401: UnauthorizedBehavior;
29}) => QueryFunction<T> =
30 ({ on401: unauthorizedBehavior }) =>
31 async ({ queryKey }) => {
32 const res = await fetch(queryKey.join("/") as string, {
33 credentials: "include",
34 });
35
36 if (unauthorizedBehavior === "returnNull" && res.status === 401) {
37 return null;
38 }
39
40 await throwIfResNotOk(res);
41 return await res.json();
42 };
43
44export const queryClient = new QueryClient({
45 defaultOptions: {

Callers 1

queryClient.tsFile · 0.70

Calls 1

throwIfResNotOkFunction · 0.70

Tested by

no test coverage detected