btraut
btraut
Explore posts from servers
TtRPC
Created by btraut on 1/17/2024 in #❓-help
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"),
})
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?
2 replies