-
Notifications
You must be signed in to change notification settings - Fork 132
Description
Description:
Currently, in gql_http_link file uploads are supported via the GraphQL multipart request spec, but there is no in it way to track upload progress when sending large files. This makes it hard to provide real-time UI feedback (such as a progress bar or percentage) to users during uploads, which is a critical UX feature in modern applications.
Use Case:
When performing a mutation like:
I want to be able to show upload progress to the user, especially for large files or slow connections.
Suggested Solution:
Expose an onUploadProgress (or similar) callback in the HttpLink API, similar to what is offered in packages like dio or http.MultipartRequest.
For example:
This is to be invoked with the number of bytes sent and the total bytes to be sent, allowing to display UI components containing upload progress.
Bonus:
Consider also providing a way to handle timeouts more flexibly, e.g., by exposing a callback when a timeout is reached but the upload is still in progress