wobsoriano / trpc-nuxt

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

`default` property in useQuery #162

Closed AlexXanderGrib closed 8 months ago

AlexXanderGrib commented 8 months ago

Hello, is there any reason why generic parameter DefaultT is absent, and replaced by hardcoded null type. I creates a situation where only default value i can provide is null, so i forced to do this:

const { data: contacts } = $client.contacts.useLazyQuery(undefined, {
  default: () => [] as unknown as null,
})

UPD: I want to make a pull request to fix this, just want to know if there was a type issue so this idea was abandoned