wobsoriano / trpc-nuxt

End-to-end typesafe APIs in Nuxt applications.
trpc-nuxt.vercel.app
MIT License
687 stars 39 forks source link

Feature Request: `useLazyQuery` #89

Closed Colonel-Sandvich closed 1 year ago

Colonel-Sandvich commented 1 year ago

Add a simple wrapper function around the existing useQuery to set the lazy option to true.

$client.post.getPosts.useLazyQuery(<input>)

Equivalent to

$client.post.getPosts.useQuery(<input>, { lazy: true })

@wobsoriano If this is something that you think is worth adding I can open a PR based on this diff (Playground changes optional)

wobsoriano commented 1 year ago

Yeah feel free to open a PR!

wobsoriano commented 1 year ago

Released in https://github.com/wobsoriano/trpc-nuxt/releases/tag/v0.10.10

Thanks!