-
I want to be able to cmd+click in my IDE to navigate to the query/mutation definition. So I want to use something other than a string. import {hello} from ...
const hello = trpc.useQuery([hello, {text: 'client'}]) export const hello = 'hello'
export const appRouter = trpc.router().query(hello, {
input: z
.object({
text: z.string().nullish(),
})
.nullish(),
async resolve(req) {
return 'hi'
},
}) But doing this without using a type makes webpack need to bring my whole backend into my frontend bundle. Is there a recommended way to do this? |
Beta Was this translation helpful? Give feedback.
Answered by
vjpr
Sep 24, 2021
Replies: 1 comment 1 reply
-
So moving |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
vjpr
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
So moving
export const hello = 'hello'
to a separate file solves things.