tRPCttRPC
Powered by
functiondjF
tRPC•3y ago•
3 replies
functiondj

How can i use inferprocedureoutput?

I'd like to write this code type-safely:
const handleQuery = (query: /* ? */) => {}

const MyComponent = () => {
  const query = trpc.foo.useQuery()
  handleQuery(query)
  // ...
}
const handleQuery = (query: /* ? */) => {}

const MyComponent = () => {
  const query = trpc.foo.useQuery()
  handleQuery(query)
  // ...
}
I'm pretty sure i need to use
inferProcedureOutput
inferProcedureOutput
but i couldn't figure out what to pass. I can never access
query.isLoading
query.isLoading
for example.
tRPCJoin
Move Fast & Break Nothing. End-to-end typesafe APIs made easy.
5,015Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?

Similar Threads

How can I use `onSettled` in the `experimental_createTRPCNextAppDirClient`?
p6l.richardPp6l.richard / ❓-help
3y ago
How can I use a fork of trpc-next?
glowyGglowy / ❓-help
4y ago
How can I use multiple DBs with trpc in T3 app?
Sycamore WillowSSycamore Willow / ❓-help
2y ago
Can I use tRPC on multiple platforms?
IGMTCryptoIIGMTCrypto / ❓-help
12mo ago