openapi-typescript icon indicating copy to clipboard operation
openapi-typescript copied to clipboard

openapi-react-query: support for useQueries()

Open michalfedyna opened this issue 1 year ago • 2 comments

@drwpow @kerwanp Do you guys think that it's possible to add support for useQueries()? I'll work on that but need some directions and opinions.

michalfedyna avatar Aug 02 '24 10:08 michalfedyna

Hey! This definitely needs to be supported in the future!

I was thinking of something like this, I'm not a big fan of the "array tupple" so if you have a better idea feel free to share!

  const userQueries = $api.useQueries({
    queries: users.map((user) => ['get', '/api/users/{id}', { params: {  path: { id: user.id } } }]),
  })

kerwanp avatar Aug 02 '24 10:08 kerwanp

I'll work on that over the weekend, I'll keep you updated.

michalfedyna avatar Aug 02 '24 11:08 michalfedyna