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

fix subscription #2

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

marktani
Copy link

@marktani marktani commented Feb 10, 2017

Explanation:

  • When using updateQuery (for subscriptions) or updateQueries (for mutations), you have to return an object whose keys will be matched with all currently known query names. That's why we have to say allTodoes
  • I changed the displaying order and removed the reverse() statement. I think this order is more natural (latest todo at the bottom of the list).

Current limitations:

  • no subscription on update/delete. We'll change the Graphcool subscription API so you can subscribe to multiple mutations at the same time, so this we'll be pretty easy to handle. Stay tuned!
  • after deleting a Todo, sometimes the UI doesn't update correctly. The correct way would be to use updateQueries instead of refetch(), however that is undergoing significant changes at the moment.
  • just as a heads up, the component setup in the example you referred to can be significantly improved. This is my bad 😛

Not sure if you consider #1 to be fixed by this.

All in all, I'd say these are not huge issues and can be fixed once the above two changes are live.
Thanks for putting this together so quickly! 💪

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants