Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
02-04-2019 06:09 AM
I am dealing with different methods of creating uniqueness over a graphql interface
currently where using neo4j-graphql-js which features auto-generated mutations for graphql types in neo4j
under the hood it's really just translating e.g. create mutations to a cypher CREATE
query
which is why duplicates can occur
busy using
e.g. using CONSTRAINT
or MERGE
i was thinking about forking the lib and extend the auto-generation method with MERGE
but maybe there is something more elegant
type Mutation {
MergeCustomer(id: ID!, device: String): Customer
@cypher(
statement: """
MERGE (S:Customer {id:$id, device:$device}) RETURN S
"""
)
MergeIPAddress(ip: String!): IPAddress
@cypher(
statement: """
MERGE (S:IPAddress {ip:$ip}) RETURN S
"""
)
...
}
but in a streaming fashion it's difficult to maintain a consistent db state as duplicate values are constantly flooding in.
02-04-2019 03:52 PM
Hi @werner - yes, we should really expose the option of using MERGE
in the generated mutations. This has come up a few times, and we've discussed a few options here: https://github.com/neo4j-graphql/neo4j-graphql-js/issues/83
Would you mind adding your thoughts to that Github issue?
02-05-2019 12:33 AM
Hey @William_Lyon - thanks for the speedy reply will add my question/ thoughts on git.
All the sessions of the conference are now available online