File upload - url or client configuration #2905
ContextI've seen how uploads are supposed to work and read the docs. ProblemThe problem is that I use apollo router on backend which doesn't support file proxying to federated service apollographql/router#842 so end service basically gets just empty object if I follow standard approach ExpectationsSo what I used to do before, is to have two instances of apollo client and for uploads, I would have different target URL (uploading directly to file management service). Now, with urql, I don't see how I can configure url or client instance for a particular mutation. Is that possible? Here I see its taking url from core -> https://github.com/urql-graphql/urql/blob/main/exchanges/multipart-fetch/src/multipartFetchExchange.ts#LL37C24-L37C24 |
Replies: 2 comments
|
You can pass url as part of the operationContext of your mutation, this is documented in the api part of our docs The second argument for the execute function https://formidable.com/open-source/urql/docs/api/urql/#usemutation |
|
Thanks, that solved it, I couldn't figure it out from typescript definitions 😄 |
You can pass url as part of the operationContext of your mutation, this is documented in the api part of our docs
The second argument for the execute function https://formidable.com/open-source/urql/docs/api/urql/#usemutation