Skip to content

Cannot upsert anything under a node that is going to be related in upsertGraph. #782

@muffinsparticus

Description

@muffinsparticus

Greetings!

I've encountered an issue that's blocking me from moving forward with objection.js at the moment.

I have a DataModel (A) that has a many to many relationship with another DataModel (B) that has a many to many relation to another DataModel (C). Whenever I perform an upsert with using DataModel A objection always tries to insert the relation between BxC into the proper join table when the relation exists.

Is this a bug with the upsert graph and if not is there a way to prevent objection from inserting duplicate relations? It seems to handles the AxB relation just fine.

P.S. It also doesn't seem to properly unrelate the BxC the relation when it doesn't exist.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions