wet-aquaW
Refine3y ago
4 replies
wet-aqua

call specific route

hi
how I can call a specific route ? for example if I want to call secndoary router to get specific data imdietlly (once opening the page), which hook I should use ?
I tried useQuery hook but I get errors:
const { data: userTypeData, isLoading: useTypeIsLoading, error: userTypeError } = useQuery({
    resource: 'userInfo', // Replace 'your-route' with the actual route you want to call
    method: 'POST', // Specify the HTTP method for the request
  });

error:
No overload matches this call.
  The last overload gave the following error.
    Argument of type '{ resource: string; method: string; }' is not assignable to parameter of type 'QueryKey'.
      Object literal may only specify known properties, and 'resource' does not exist in type 'readonly unknown[]'.ts(2769)
useQuery.d.ts(16, 25): The last overload is declared here.
(property) resource: string
Was this page helpful?