You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Nested delete mutations with relationships to unions and subscriptions enabled fail to delete all targeted nodes depending on the union definition in the schema
#4037
Open
a-alle opened this issue
Sep 27, 2023
· 3 comments
Describe the bug
Given a relationship to a Union type and with subscriptions enabled, the following nested delete mutation does not delete all targeted nodes.
Notice that this is related to the order of graphql arguments. If the order of the member object types is switched in the definition of the union Director, then all nodes are being deleted.
Type definitions
typeMovie {
title: String!actors: [Actor!]!@relationship(type: "ACTED_IN", properties: "ActedIn", direction: IN)
directors: [Director!]!@relationship(type: "DIRECTED", properties: "Directed", direction: IN)
reviewers: [Reviewer!]!@relationship(type: "REVIEWED", properties: "Review", direction: IN)
}
typeActor {
name: String!movies: [Movie!]!@relationship(type: "ACTED_IN", properties: "ActedIn", direction: OUT)
}
interfaceActedIn@relationshipProperties {
screenTime: Int!
}
interfaceDirected@relationshipProperties {
year: Int!
}
interfaceReview@relationshipProperties {
score: Int!
}
typePersonimplementsReviewer {
name: String!reputation: Int!movies: [Movie!]!@relationship(type: "REVIEWED", direction: OUT, properties: "Review")
}
typeInfluencerimplementsReviewer {
reputation: Int!url: String!
}
# this union definition results in failure of deletion of all targeted nodesunionDirector = Person | Actor # this union definition does indeed work and all targeted nodes are getting deleted # union Director = Actor | PersoninterfaceReviewer {
reputation: Int!
}
See that the node (:Person {name: "Julia", reputation:10}) does get disconnected but it does not get deleted even though it was targeted for deletion.
Comment-out the union Director definition and uncomment the second one
Run set-up cypher again
Run delete mutation again
Notice the node (:Person {name: "Julia", reputation:10}) does get deleted.
Expected behavior
The node should have been deleted no matter which order the member types are defined in the union definition.
More than that, any graphql definition order in the schema should not have an impact on the behaviour of the generated Cypher.
The text was updated successfully, but these errors were encountered:
We've been able to confirm this bug using the steps to reproduce that you provided - many thanks @a-alle! 🙏 We will now prioritise the bug and address it appropriately.
Describe the bug
Given a relationship to a Union type and with subscriptions enabled, the following nested delete mutation does not delete all targeted nodes.
Notice that this is related to the order of graphql arguments. If the order of the member object types is switched in the definition of the union
Director
, then all nodes are being deleted.Type definitions
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The node should have been deleted no matter which order the member types are defined in the union definition.
More than that, any graphql definition order in the schema should not have an impact on the behaviour of the generated Cypher.
The text was updated successfully, but these errors were encountered: