Skip to content

Impossible to pass multiple arguments to mutation function in useMutation hook #1322

@CedricVanhaverbeke

Description

@CedricVanhaverbeke

Describe the bug
I cannot seem to pass mutliple arguments to a function created with the useMutation hook.

To Reproduce

// create a mutation
const [mutation] = useMutation((...elements) => console.log(elements));

// execute the mutation with multiple parameters
mutation(1,2,3);

// output is this:
[1]

Expected behavior
I'd expect the full array of arguments like this:

[1,2,3]

Am I missing something?

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