I am using GRAND stack - neo4j database and apollo server. Also using the augmentedSchema of neo4j-graphql-js. This adds more types and mutations to the GraphQL schema.
I have a type Option with the following typedef:
type Option {
id: ID
name: String
position: Int
values: [String]
}
Using the CreateOption mutation generated by neo4j-graphql-js, I am able to create an Option. The problem I am facing is that I can create multiple options with the same ID.
mutation {
opt1: CreateOption(id: 1, name: "Test") {
id
}
opt2: CreateOption(id: 1, name: "Test 2") {
id
}
}
The result of the above mutation is
{
"data": {
"opt1": {
"id": "1"
},
"opt2": {
"id": "1"
}
}
}
Why is neo4j allowing two nodes with the same ID? How can I ensure nodes with unique IDs in neo4j?