Skip to content

[vue-query] Callback for enabled does not provide query as parameter #7905

Open
@Jak-Ch-ll

Description

@Jak-Ch-ll

Describe the bug

Since v5.48.0 and the changes in #7566 the enabled property for TanStack Query in general does accept a callback function, which provides the the query as argument.

Sadly this does not work with vue-query, as vue-query did already accept a getter since #6018, which does not provide the query. It technically is possible to return a function from the getter and that one will provide the query, but that does not fit the current types and docs. In addition it seems to run unnecessarily often, as you can see in my example repro.

Your minimal, reproducible example

https://stackblitz.com/edit/vitejs-vite-dt8byq?file=src%2FApp.vue

Steps to reproduce

  1. Open the console
  2. The parameter outerQuery in undefined

Expected behavior

The parameter outerQuery to be the query

Tanstack Query adapter

vue-query

TanStack Query version

5.51.21

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