Skip to content

Dependant queries #1413

Closed
Closed
@stromkalle

Description

@stromkalle

Describe the bug

Dependant queries leave an in between state after the first query has succeeded where the first query has a successful status and the following query is still in idle.

To Reproduce

const queryA = useQuery("queryA", fetchSomething);
const queryB = useQuery("queryB", fetchSomethingElse, { enabled: queryA.isSuccess });

console.log(queryA.status, queryB.status);

// loading idle
// success idle
// success loading

Expected behavior
I expect there to be no inbetween state and for queryB to go into a loading state as soon as queryA has succeeded. Expected console log would be:

// loading idle
// success loading
// success success

Desktop (please complete the following information):

  • OS: macOS Catalina
  • Chrome
  • Version: 3.2.0

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