Skip to content
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

Feature Request: Support for Automatic persisted queries #582

Closed
Arthurius opened this issue Jun 13, 2019 · 8 comments
Closed

Feature Request: Support for Automatic persisted queries #582

Arthurius opened this issue Jun 13, 2019 · 8 comments
Labels
enhancement Issues outlining new things we want to do or things that will make our lives as devs easier
Milestone

Comments

@Arthurius
Copy link

To improve network performance with GraphQL, it would really be nice to have the option to enable APQ in the iOS ApolloClient. On Android this feature is already implemented like this:

ApolloClient.builder()
     /* ... */
     .enableAutoPersistedQueries(true)
     /* ... */
     .build()
@Codebear98
Copy link

Hi, I'm actively working on this.

@Codebear98
Copy link

Better merge #572 first, as it will need useGetMethodForPersistedQueries for APQs with Couldflare support.

@SirensOfTitan
Copy link

SirensOfTitan commented Jun 28, 2019

I hacked together really super basic support for APQ today on this branch here (It is pointing to my forked master branch though): https://github.com/SirensOfTitan/apollo-ios/tree/sirensoftitan/jun-28/apq

I didn't build subscription support yet, and haven't added GET support for queries yet. I essentially just created an APQNetworkTransport that wraps another network transport and handles persisted queries. I could probably just not use CryptoSwift and use CommonCrypto instead for sha256 hashes.

My feeling after adding this is that a lot of this stuff is starting to feel a bit busy. It might be getting to the point where an ApolloLink kind-of abstraction for iOS would be really valuable.

@dmandarino
Copy link

@SirensOfTitan a branch that supports GET method is already merged. What do you think of updating your branch to continue your work?

It would be great to have persisted queries.

@SirensOfTitan
Copy link

SirensOfTitan commented Jul 1, 2019 via email

@SirensOfTitan
Copy link

#601

@Codebear98
Copy link

Ops. Actually I was testing it for weeks, anyway I made a PR too #608
It supports fetchOption and also useGetMethodWithPersistedQueries which sync up the changes on Android project for CDN support.

Please see if it's useful for you.

@designatednerd designatednerd added the enhancement Issues outlining new things we want to do or things that will make our lives as devs easier label Jul 11, 2019
@designatednerd designatednerd added this to the 0.17.0 milestone Oct 22, 2019
@designatednerd
Copy link
Contributor

This support shipped with 0.17.0! I missed this issue when I was closing everything else out. Please file a new issue if there's anything not working correctly with this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Issues outlining new things we want to do or things that will make our lives as devs easier
Projects
None yet
Development

No branches or pull requests

5 participants