Skip to content

composition API, trigger refetch/restart when query already running does not work #1058

@karladler

Description

@karladler

Describe the bug
Triggering a refetch of an already running query seems not to work, when the query is still loading.

To Reproduce
Steps to reproduce the behavior:

  • 1st define a (long running) query using useQuery
const {
      result, error, loading, variables, restart, refetch,
    } = useQuery(myQuery, {
      // args ...,
    },
    {
      fetchPolicy: 'cache-and-network',
    });
  • 2nd load the view with the query
  • 3rd while the query is still loading try to trigger refetch() or restart()

Expected behavior
A new request should be triggered and be visible in the network tab.

Versions
vue: 2.6.12
vue-apollo: 3.0.4
apollo-client: 2.6.10

Additional context
I'm not 100% sure if this is a bug or intended behavior. If this is intended, please let me know, how an already running request may be aborted and re-triggered.

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