-
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
Add support for Automated Persisted Queries #601
Add support for Automated Persisted Queries #601
Conversation
@SirensOfTitan: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Meteor Contributor Agreement here: https://contribute.meteor.com/ |
c1d09ce
to
a27f3df
Compare
a27f3df
to
801d5b0
Compare
@designatednerd: okie dokie! I hacked this up quickly for myself, happy to adjust for upstream changes or help with the other PR that adds this if you all are happier with that direction. |
Hey @SirensOfTitan it looks like things have moved on quite a bit further with #608 - do you mind if we go ahead with that one and close this one out? |
@designatednerd Sure! Whatever works best for you! I can also rebase this if you'd like, whatever works! Codebear's diff is great. Thoughts that are a totally ignore if not helpful or relevant:
|
Cool, thank you for the feedback! |
Description
Sorry, I didn't quite follow the contributing guidelines for this, as I want to start testing this in our app now.
This introduces APQ to apollo-ios by:
APQNetworkTransport
class intended to wrap anHTTPNetworkTransport
andWebsocketTransport
.includeQuery
andextensions
, the latter of which is a GraphQLMap.sha256
. Happy to switch over to some bridge usingCommonCrypto
or by only importing some sha256 implementation.Additionally, I noticed that GETs don't work right now as advertised for any variables payload with
nil
, primarily around:https://github.com/apollographql/apollo-ios/blob/master/Sources/Apollo/HTTPNetworkTransport.swift#L178
...because the
.jsonObject
accessor is called onvariables
, which encodesnil
s toNSNull
, then the JSONSerializer calls.jsonObject
again, leading to a fatal asNSNull
is not JSONSerializable.I fixed that up by just ensuring we don't call
.jsonObject
for items passed to JSON serializable. I tested this by applying the patch just toapollo-ios
trunk and running a couple tests usingGET
.re:formatting: there are some places in the code that use 2 spaces and some that use 4, unsure if there's a standard here.
I'm also presenting this PR as a branch off of my fork of apollo-ios. It should merge cleanly regardless of my changes to master, but if not I can rebase against upstream.
Test Plan
I've just started running apollo-ios against a project of mine to get some basic anecdotal signal that the app works as expected. So far so good, although I haven't really validated against websockets yet.
I'm very happy to add tests after the approach here is accepted. I would like to minimally add tests for: