Skip to content
This repository was archived by the owner on Apr 13, 2023. It is now read-only.
This repository was archived by the owner on Apr 13, 2023. It is now read-only.

withMutation should support loading/error/called/data states #2952

@slikts

Description

@slikts

Previous (closed) issues: #421 #1842

The graphql() (and withMutation()) HOCs currently have a surprising limitation in that the mutation results aren't passed by them, which isn't explained by the docs, and there also isn't an obvious reason for it. The natural expectation from reading the docs would be that HOCs and components would have feature parity (despite HOCs having fallen by the wayside to render props and more recently hooks) and would just be alternative APIs for the same functionality, especially since graphql() delegates to components under the hood. In other words, passing mutation results in withMutation() would follow the principle of least surprise.

The answer also shouldn't be "just use components or hooks"; the reason to pick HOCs currently is that components suffer from "wrapper hell" unless a helper library like react-adopt is used, and that hooks are still immature.

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