Skip to content

Non integer id broken with mutation #62

Closed
@mkaay

Description

@mkaay

If a mutation returns a non integer id (like a relay node), a new record with id NaN is created.
I found this while debugging:

newData.id = parseInt(newData.id, 10);

Something like this might be better:

const newId = Number.parseInt(newData.id, 10);
if (!Number.isNaN(newId)) {
    newData.id = newId;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions