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

How to update child component query when its sibling child component does a mutation? #54

Closed
AnnieTaylorCHEN opened this issue Aug 19, 2020 · 1 comment

Comments

@AnnieTaylorCHEN
Copy link

AnnieTaylorCHEN commented Aug 19, 2020

Hi so I have two child component Cart and Orders in parent component App

Cart have mutations with variables A, B, C.
In the example we have :
$: books.refetch({A, B, C });
but $books query are also in the same component.
After this I want its sibling Order to update the orders.

How could I communicate between them?

@AnnieTaylorCHEN AnnieTaylorCHEN changed the title How to update parent component query values when child component have mutations? How to update child component query when its sibling child component does a mutation? Aug 20, 2020
@timhall
Copy link
Owner

timhall commented Nov 18, 2020

Sorry for the late reply, basically you should either store the state in the parent App component or if they're not direct descendants then you could use svelte's context API

@timhall timhall closed this as completed Nov 18, 2020
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

No branches or pull requests

2 participants