thomasplayschess
thomasplayschess
TtRPC
Created by function on 9/12/2023 in #❓-help
404 TRPCError: no query procedure on path
Awesome, glad I could help! 🙂
18 replies
TtRPC
Created by thomasplayschess on 9/13/2023 in #❓-help
Wrapping useQuery into a custom hook
But thanks again for your help. I wouldn't have been able to solve this without your help 🙂
74 replies
TtRPC
Created by thomasplayschess on 9/13/2023 in #❓-help
Wrapping useQuery into a custom hook
I got it btw, had to add UseTRPCQueryResult<inferProcedureOutput<QueryProcedure>, TRPCClientErrorLike<QueryProcedure>> as return type.
74 replies
TtRPC
Created by function on 9/12/2023 in #❓-help
404 TRPCError: no query procedure on path
It should give you something like "400 Bad Request" and not a 404 if the path is correct.
18 replies
TtRPC
Created by thomasplayschess on 9/13/2023 in #❓-help
Wrapping useQuery into a custom hook
Actually, it's really close... But not 100% working as I've only just now noticed. The type hints, etc. is all working great for the input, but the output is always any.
const result = runProcedure(trpc.foo, "aoidwoij");
result.data // type is always any
const result = runProcedure(trpc.foo, "aoidwoij");
result.data // type is always any
Maybe AnyQueryProcedure is not the right type. I will give this another try tomorrow... 🙈
74 replies
TtRPC
Created by function on 9/12/2023 in #❓-help
404 TRPCError: no query procedure on path
Is the server behind a reverse proxy? What do you get when you call http://localhost:3000/foo?
18 replies
TtRPC
Created by thomasplayschess on 9/13/2023 in #❓-help
Wrapping useQuery into a custom hook
(just FYI, if anyone comes across this)
74 replies
TtRPC
Created by thomasplayschess on 9/13/2023 in #❓-help
Wrapping useQuery into a custom hook
WTF, I've used the "mark as solved" on the wrong message (thought it would apply to the whole thread) and now it believes that the emoji is the answer 🤦‍♂️ Well... Looks like I cannot undo my mistake.
74 replies
TtRPC
Created by function on 9/12/2023 in #❓-help
404 TRPCError: no query procedure on path
At least it looks to me like you are not setting it up on any path, so the default should just be http://localhost:3000
18 replies
TtRPC
Created by function on 9/12/2023 in #❓-help
404 TRPCError: no query procedure on path
Maybe the URL is just wrong? Try to change this url: "http://localhost:3000/trpc" to this: url: "http://localhost:3000"
18 replies
TtRPC
Created by thomasplayschess on 9/13/2023 in #❓-help
Wrapping useQuery into a custom hook
Thank you very much again. And if you want stackoverflow points please answer the question and I will accept it.
74 replies
TtRPC
Created by thomasplayschess on 9/13/2023 in #❓-help
Wrapping useQuery into a custom hook
Sure!
74 replies
TtRPC
Created by thomasplayschess on 9/13/2023 in #❓-help
Wrapping useQuery into a custom hook
YESSS
74 replies
TtRPC
Created by thomasplayschess on 9/13/2023 in #❓-help
Wrapping useQuery into a custom hook
🥳
74 replies
TtRPC
Created by thomasplayschess on 9/13/2023 in #❓-help
Wrapping useQuery into a custom hook
AWESOME, I'll try it
74 replies
TtRPC
Created by thomasplayschess on 9/13/2023 in #❓-help
Wrapping useQuery into a custom hook
At least I got that right... But no clue how I make DecorateProcedure<TProcedureOrRouter, TFlags, TPath> generic now 🙈
74 replies
TtRPC
Created by thomasplayschess on 9/13/2023 in #❓-help
Wrapping useQuery into a custom hook
Much appretiated
74 replies
TtRPC
Created by thomasplayschess on 9/13/2023 in #❓-help
Wrapping useQuery into a custom hook
Thanks for taking the time btw! 🙂
74 replies
TtRPC
Created by thomasplayschess on 9/13/2023 in #❓-help
Wrapping useQuery into a custom hook
Yes 😦 This is the type I'm getting when looking at trpc.oneofmyroutes:
object & {
getQueryKey: (input: {
// MY INPUT PARAMS
}, type?: QueryType | undefined) => QueryKey;
useQuery: ProcedureUseQuery<...>;
useSuspenseQuery: <TQueryFnData extends {
...;
} = {
...;
}, TData = TQueryFnData>(input: {
// ALSO MY INPUT PARAMS (?)
}, opts?: Omit<...> | undefined) => [...];
}
object & {
getQueryKey: (input: {
// MY INPUT PARAMS
}, type?: QueryType | undefined) => QueryKey;
useQuery: ProcedureUseQuery<...>;
useSuspenseQuery: <TQueryFnData extends {
...;
} = {
...;
}, TData = TQueryFnData>(input: {
// ALSO MY INPUT PARAMS (?)
}, opts?: Omit<...> | undefined) => [...];
}
74 replies
TtRPC
Created by thomasplayschess on 9/13/2023 in #❓-help
Wrapping useQuery into a custom hook
I'll give that AnyQueryProcedure another try that you've mentioned.
74 replies