Skip to content

prefetching for a dependent query leads to useQuery returning undefined data after query executes #199

@brumm

Description

@brumm

Hey Tanner,

I think I might have found a bug involving prefetching and dependent queries.

  • We prefetch a query for key 'key'
  • A dependent query for key 'key' is initially not run, because the queryKey is falsy
  • The falsy queryKey changes to truthy
  • Expectation: The query for key 'key' returns prefetched data
  • Reality: The query for key 'key' returns undefined

Here's a reproduction sandbox: https://codesandbox.io/s/react-query-bug-repro-2mxdd

This might be related to #195

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions