Cattpot
Cattpot3w ago

unstable_httpBatchStreamLink and formData -> not compatible

Hy, i am using unstable_httpBatchStreamLink to use the async generators and it is working very well. But if I use this Link i cannot upload any File with Formdata. if im using the normal httpLink I can upload the files with Formdata but not use the async generators. The input Validation uses zod-form-data "zfd.formData({ file: zfd.file() })" like in the documentation.. pls help me, maybe I am using the links in a bad way? Using V11
Solution:
links: [ splitLink({ condition: (op) => op.path=== 'MyPathFromFormData', true: unstable_httpSubscriptionLink({ url,...
Jump to solution
2 Replies
Cattpot
CattpotOP3w ago
I found https://trpc.io/docs/client/links/splitLink I think it will help me
Solution
Cattpot
Cattpot3w ago
links: [ splitLink({ condition: (op) => op.path=== 'MyPathFromFormData', true: unstable_httpSubscriptionLink({ url, transformer, }), false: httpBatchLink({ url, transformer, }), }), ],

Did you find this page helpful?