-
Notifications
You must be signed in to change notification settings - Fork 162
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
AC-11 Support AC local state #166
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This all looks great @cheapsteak - thanks very much for working on this!
@cheapsteak Let's leave this un-merged for now, just until we know the official launch date of the Apollo Client local state changes. Thanks again! |
src/backend/links.js
Outdated
// is being used. | ||
|
||
const supportsApolloClientLocalState = | ||
typeof apolloClient.getTypeDefs === "function"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hwillson Just a note that apollographql/apollo-client@d3931b8 may have broken this logic (which is fine as long as we make the logic work again before we ship apollo-client@2.5.0
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With this commit, the new way to get the client typeDefs
will be apolloClient.typeDefs
: apollographql/apollo-client@adfd9c0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
32b6113
to
4333c28
Compare
f4339ca
to
ac35b34
Compare
To work with the new Apollo Client local state changes, this commit adjusts devtool querying to use Apollo Client itself, instead of building a custom link chain.
ac35b34
to
75d24e4
Compare
The version we were using before couldn't `parse` the `ObjectTypeExtension` type.
99.9% of this was done by Hugh, really appreciated the extremely thorough comments
I just moved a few lines around and double checked that it's working against our full stack tutorial (which uses AC local state) and pupstagram (which uses link-state)
I did find that running link-state mutations doesn't work (in the case of pupstagram, running the
toggleLikedPhoto
mutation results in agetCacheKey is not a function
error), but it's broken the same way in the currently published version of devtools as well, so it's likely that it hasn't worked in the pastI'm not sure if there's much else worth saying here. The meat of the changes is in
links.js
, and Hugh's comments do a great job of explaining what and why