Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't use assignment for MERGE/Update #105

Closed
jexp opened this issue Aug 6, 2020 · 2 comments · Fixed by #117
Closed

Don't use assignment for MERGE/Update #105

jexp opened this issue Aug 6, 2020 · 2 comments · Fixed by #117
Assignees

Comments

@jexp
Copy link
Contributor

jexp commented Aug 6, 2020

See the discussion here:

#99 (review)

Switch from SET x = {...} to SET x += {} or individual set operations.
We could also consider putting the data just into a parameter instead. So it would become SET x += $data

Usually you merge on a single field (in exceptional cases on a set of fields). (they keys that are used to look-up nodes for uniqueness)
And update fields are the fields that are added/overriden.

As MERGE is get-or-create you don't want to destroy existing additional data that might have been added in between by other means.

And if you leave off fields it doesn't mean you want to remove them, just that you don't have data (or updates) for them at the moment.

@rbramley
Copy link
Contributor

This causes a critical problem for data that has been loaded from CSV files where the existing external :ID field has been retained.
The result of an update mutation is that the ID field is stripped from the node.

@Andy2003
Copy link
Collaborator

@rbramley your issue was resolved by #95

Andy2003 added a commit to Andy2003/neo4j-graphql-java that referenced this issue Aug 28, 2020
…nset for when updating a node.

Now we always use `SET x += {}` to update properties.
@jexp jexp closed this as completed in #117 Aug 30, 2020
jexp pushed a commit that referenced this issue Aug 30, 2020
… updating a node. (#117)

Now we always use `SET x += {}` to update properties.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants