Skip to content

When adding a mutation dynamically via "setMutator", all fields with the same name across all stores have the mutation applied #1992

@pappascd81

Description

@pappascd81

Environment

Playground.

Reproduction

Playground link.

Describe the bug

Found another bug unless I am specifying the key incorrectly or using this incorrectly. I have a use case for needing to set a mutation dynamically on a store. However, when attempting to do so via StoreClass.setMutator(field, mutation), all fields with the same name in other stores have their values mutated as well.

I used the base example again, but added 'title' to the User class and set a Mutator just before useRepo is called. When viewing the Todo list of a User, you can see their titles affected as well.

Additional context

No response

Logs

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions