-
Notifications
You must be signed in to change notification settings - Fork 730
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Availilability of zipping payload while performing mutation
query
#782
Comments
That's not currently something we handle - I'll mark this as an enhancement but I'll admit this is likely pretty low on our priority list at the moment, especially because mutations are very rarely this big. I'd strongly recommend breaking that mutation up into smaller pieces, and I'd talk to your BE team about why they need all that data at once if they don't have the ability to upload those HealthKit data pieces separately. |
You could create a Create it to be very similar to Apollo's HTTPNetworkTransport class, but implement your own custom func send(...) In there gzip the body before firing session.datatask. As soon as you want to fire a query that needs to be Gzipped, use this class when you instance the ApolloClient
Hope this helps, example implementation of the Happy coding!
|
@sauvikaktivo Please check out the RFC for networking changes at #1340 - I believe you should be able to make a subclass of |
We are about to beta the new networking stack and indeed, creating a subclass of |
The networking stack is now available as a beta at |
The Problem I am facing
For my current project I have a mutation query
Sometimes (it's unavoidable in current architecture) the total mutation payload data becomes more than
10MB
in size, then, we are unable (or takes too much time for weak cellular networks) to upload the payload.The solution I am seeking
I want to zip the payload which is getting prepared under
ApolloClient.perform(mutation:queue:resultHandler:)
of Apollo client usingGZip
. I dig intoHTTPNetworkTransport.send<Operation>(operation: Operation, completionHandler: @escaping (_ response: GraphQLResponse<Operation>?, _ error: Error?) -> Void) -> Cancellable
and found body data is getting prepared by serializing request body. Is there any way we can compress this data before assigning torequest.httpBody
?Thanks in advance.
The text was updated successfully, but these errors were encountered: