-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
[WIP] Apollo 2: apollo-state-link and RR4 #2083
Conversation
b562f12
to
a50fc3d
Compare
meteor/apollo Atmosphere version does not seem up to date with the Github repo
Nice!
Yep. It's a replacement for the old
No I don't think it has anything to do with realtime.
Yep.
In core I think only
Hopefully we can keep the same API. |
I setup a demo code, but did not test it yet as for the moment no component seem to use My current understanding:
The difficulty here is to be able to replace/add a mutation inside the state link, as See the issue I opened on |
We could probably work around that by adding our own |
Definitely what I thought afterward, I did not remember initialization was handled in startup e.g for fragments. We indeed will have to do the same for the apollo client, until they add some function like a " I am cleaning up the code, then I will merge to the |
I merged since I have a working version. I did not experiment the |
What's |
Starter PR
I started to work on the replacement of redux by apollo-state-link.
So far I have:
read code
understood the role of redux related to apollo-client
learnt what are apollo links and how apollo-state-link is a replacement to redux in regards to data storing
moved files a little. Most of the code realted to apollo-client seems totally generic and reusable for any frontend client that would like to connect to the Vulcan app, so it sounds a good idea to isolate it.
wrote a very basic setup for apollo state link that does nothing
implemented
registerMutation
,registerDefault
and deferred the Apollo client creation until startup.wrote a few test but couldn't run them yet
wrapped default_mutations call to
registerWatchedMutation
withMeteor.isClient
(apollo client methods have no meaning server side, so the code is now inclient
instead ofmodules
)updated core components to use React Router 4
fixed App.jsx route Switch exact props
Please correct me if I am wrong:
createTodo
, the watchedMutation of user B is called a few second later), or is this totally unrelated?cache
. Instead of defining actions, we now define cacheMutations that uses writeCache.