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

Change query arguments while polling on an endpoint #4560

Open
pugsh opened this issue Aug 14, 2024 · 0 comments
Open

Change query arguments while polling on an endpoint #4560

pugsh opened this issue Aug 14, 2024 · 0 comments

Comments

@pugsh
Copy link

pugsh commented Aug 14, 2024

I am polling on an api like below
const query = endpoints.getTasks.initiate(taskIds, { subscriptionOptions: { pollingInterval: 30 * 1000, skipPollingIfUnfocused: true, refetchOnFocus: true } })
taskIds can change over time and for that I am using
query.abort(); query.updateSubscriptionOptions({ pollingInterval: 0 }); query.unsubscribe();
I am facing an issue here, when there is one query still in progress and taskIds changes new queries are rejected as getTasks uses a fixed value in serializeQueryArgs.

  1. Is there a way to run the api using the last received taskId?
  2. Is there any way to change the query parameter of of polling queries like updateSubscriptionOptions?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants