Accessing useQuery inputs in a msw handler #2238
-
I am trying to access inputs to trpc useQuery in msw handler const { isLoading, isError, data } = trpc.topTraders.useQuery({
count: maxCount,
timeframe: selectedTopTradersPeriod,
}); and as per docs these are the few thing i found but they return nothing/ undefined http.get(`${baseUrl}/topTraders`, ({ request }) => {
const url = new URL(request.url);
console.log("Intercepted request for traders list", url);
console.log("Params", url.searchParams.get("count"));
}) is there any way we can get access to count and timeframe values here ? |
Beta Was this translation helpful? Give feedback.
Answered by
kettanaito
Sep 13, 2024
Replies: 1 comment
-
Hi. You access those values from the same place where they are being set in your It can be either query parameters or in the request body. Consult your request library's docs to learn where the |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
kettanaito
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi. You access those values from the same place where they are being set in your
useQuery
hook.It can be either query parameters or in the request body. Consult your request library's docs to learn where the
count
andtimeframe
values are being set.