btrautB
tRPC2y ago
1 reply
btraut

trpc's useQuery with undefined input adds extra {"values":["undefined"]} to query

My React app has several calls to query endpoints that have no input data but that do need useQuery params:

const result = trpc.onboarding.activationSteps.useQuery(undefined, {
  cacheTime: ms("10m"),
})


These calls result in tRPC fetching the following:
/trpc/onboarding.activationSteps?input={"json":null,"meta":{"values":["undefined"]}}

I'd really like to avoid all the extra query param junk. Is there a way to leave this off and just call /trpc/onboarding.activationSteps?
Was this page helpful?