+1 for adding the @unique directive to interface.
I am using uuid: String@id
on interface and was surprised that the add mutation for different types of that interface would be possible even the same ‘unique’ uuid
was provided.
I found the error message for mutations with linked interface where multiple types with the same uuid existed a bit confusing (because it mentions the invisible/ internally used ID and not the conflicting uuids):
“message”: “mutation addPost failed because Found multiple nodes with ID: 0x63aaa”
# schema
interface post { uuid: String! @id }
type blogpost implements post { links: [post]}
type comment implements post {}
# previously added data
{ type: blogpost, uuid: 123}
{ type: comment, uuid: 123}
# new mutation
addBlogpost(uuid: x, links: [123])
# results in confusing error msg: "Found multiple nodes with ID 0x63aaa"
# better error msg: "Found multiple nodes with uuid 123"