-
I have a mutation which then is used for query. The query uses the const downloadMutation = api.batch.triggerDownload.useMutation();
const log = api.batch.requestLog.useQuery(
{ id: downloadMutation.data?.jobId }, // Type undefined is not assignable to type string
{ enabled: !!downloadMutation?.data },
); |
Beta Was this translation helpful? Give feedback.
Answered by
TkDodo
Feb 13, 2024
Replies: 1 comment
-
https://tkdodo.eu/blog/react-query-and-type-script#type-safety-with-the-enabled-option |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
stychu
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://tkdodo.eu/blog/react-query-and-type-script#type-safety-with-the-enabled-option