Skip to content

Change query arguments while polling on an endpoint #4560

Open
@pugsh

Description

@pugsh

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions