Skip to content

Change pollInterval #1599

@waitstop

Description

@waitstop

In @vue/apollo-composable, the following code won’t work as expected:

const { result: episodesResult, fetchMore: fetchMoreEpisodes, loading: episodesLoading, onResult: onEpisodesResult, startPolling, stopPolling, } = useQuery(
  GetEpisodesDocument,
  episodesVariables,
  { pollInterval: 500 }
)

Why:

  1. startPolling and stopPolling do not exist in @vue/apollo-composable — they are only in Apollo Client for React.
  2. pollInterval is read only once when the query is created. Changing it later won’t start or stop polling.

Are there any built-in options or recommended patterns in @vue/apollo-composable to switch polling on and off without manually managing timers?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions