MCPcopy Create free account
hub / github.com/WardAnalytics/WardGraph / getGetLabelsQueryOptions

Function getGetLabelsQueryOptions

src/api/labels/labels.ts:60–76  ·  view source on GitHub ↗
(address: string, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getLabels>>, TError, TData>, }
)

Source from the content-addressed store, hash-verified

58
59
60export const getGetLabelsQueryOptions = <TData = Awaited<ReturnType<typeof getLabels>>, TError = unknown>(address: string, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getLabels>>, TError, TData>, }
61) => {
62
63const {query: queryOptions} = options ?? {};
64
65 const queryKey = queryOptions?.queryKey ?? getGetLabelsQueryKey(address);
66
67
68
69 const queryFn: QueryFunction<Awaited<ReturnType<typeof getLabels>>> = ({ signal }) => getLabels(address, signal);
70
71
72
73
74
75 return { queryKey, queryFn, enabled: !!(address), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getLabels>>, TError, TData> & { queryKey: QueryKey }
76}
77
78export type GetLabelsQueryResult = NonNullable<Awaited<ReturnType<typeof getLabels>>>
79export type GetLabelsQueryError = unknown

Callers 1

useGetLabelsFunction · 0.85

Calls 1

getGetLabelsQueryKeyFunction · 0.85

Tested by

no test coverage detected