Skip to content

nodeId is the same for all records if the source record in DynamoDB doesn't contain an id field (or id isn't a unique field) #1

@housser

Description

@housser

Thanks for the plugin first of all! It's great to see so many slick integrations for Gatsby like this, and is really exciting me about the design of Gatsby.

I've just been having an issue consuming some Dynamo tables of mine though. I've noticed that if your source records in DynamoDB don't have an id field, then when you try to generate a UUID for the node we end up getting the same id for each node, since we end up just passing dynamodb- in to createNodeId each time. This results in the nodes clobbering each other.

To get around this for the short term I've just started using nodeContentDigest in cases when item.id is null, but I'm pretty new to the Gatsby ecosystem, so not sure if this is a reasonable approach or not. It seems that the only requirements on createNode is that id be unique, which nodeContentDigest seems like it would satisfy.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions