Skip to content

Is it correct to re-create a query subscription when the arguments change? #3238

Answered by kitten
velidan asked this question in Q&A
Discussion options

You must be logged in to vote

prevent duplicated subscriptions if the first one is already exists but the service tries to create the new one

I'm not sure if you'll necessarily have to handle this for queries. If you check the Client, it basically already does a lot of deduplication and you only have to make sure you unsubscribe when you don't need results anymore.

The deduplication should be handled for you however 🤔

what to do if we have some pagination query. I created a subscription for this query with some arguments like: first: 1, limit: 10 but later the arguments change: first: 2, limit: 20. So what to do with that?

This is not a trivial question.
In theory, you'll have to combine and keep multiple sources …

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@velidan
Comment options

@kitten
Comment options

@velidan
Comment options

Answer selected by velidan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants