Apollo-ios: Add support for Automatic Persisted Queries

Created on 25 Sep 2018  路  5Comments  路  Source: apollographql/apollo-ios

Add support for APQ: https://www.apollographql.com/docs/guides/performance.html#automatic-persisted-queries

Automate hashing of the query (sha256, see above link), and GET request construction.
Retry with current logic if the query is not found in the cache (above GET returns an error with message == PersistedQueryNotFound)
Add a configuration option to the client that allows this to be enabled (default off).

Can anyone point at a reference implementation so I don't have to reverse-engineer from the above doc?

enhancement

Most helpful comment

Is there any movement on adding this as a Feature to Apollo? Would like to see this as we want to optimize our calls as much as possible.

Also would like to add that the link above is broken now 馃槥

All 5 comments

Started work on this, but not sure how to test since it's in a single layer (transport), and the star wars server doesn't seem to support it.

Anyone know of a simple server that I can get running to test against?

Support for APQ would be great! It would really make things more scale-able and efficient.

Is there any movement on adding this as a Feature to Apollo? Would like to see this as we want to optimize our calls as much as possible.

Also would like to add that the link above is broken now 馃槥

Just made a PR for this #608
which support GET for CDN too, retry with QueryDoc if APQs not cache, and use POST for retry to avoid 2k length limitation of query string.

This has shipped with 0.17.0! If you run into any problems with it, please file a new issue. Thank you!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jeromeDms picture jeromeDms  路  5Comments

Robuske picture Robuske  路  3Comments

wnagrodzki picture wnagrodzki  路  4Comments

vishal-p picture vishal-p  路  4Comments

StanislavCekunov picture StanislavCekunov  路  3Comments