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

Add support for subscriptions, plus Typescript type definitions #1

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

DanielRose
Copy link

An incoming subscription looks (almost) the same as a mutation. The only difference is that there is no such thing as an "optimistic" subscription. Thus, the only change needed is to add a check whether the operation's type is "subscription".

To help differentiate the callbacks of mutations and subscriptions, the callback argument for a subscription has a member called subscription instead of mutation.

For more type-safe usage in Typescript, this also includes type definitions. Most of the internals are not typed. The exception is the cache manager, since it is also being used in tests.

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.

1 participant