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
Found a bug while working on the global node resolution.
If you try and disconnect a relationship based on an aliased field, the translate function doesn't implement the alias.
I think the issue boils down to the fact that the the mapDbToProperty function is not called when resolving a disconnect field. The where filter on a disconnect is ultimately resolved by the createRelationshipWhereAndParams or createNodeWhereAndParams functions, neither of which uses mapDbToProperty, whereas the translation function for connect where args createWhereAndParams does.
constselectedId=""// Id Returned for "The Empire"constinput={where: {name: "Luke Skywalker"},connect: {activeOrganization: {where: {node: {id: selectedId}},},},disconnect: {activeOrganization: {where: {node: {id_NOT: selectedId}},},},}
Expected behavior
The mutation should connect Luke to the Empire and Disconnect him from the Rebels. But if you run the following cypher in the Neo4J browser, you'll see that he is actively managing both.
MATCH (u:User {name: "Luke Skywalker"})-[r:ACTIVELY_MANAGING]->(o:Organization)
RETURN u, r, o
Screenshots
This is a similar call for the schema I'm working with. Notice that the property connect uses for the equality check is _id while the one used for disconnect is the non-aliased field id
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 @litewarp! 🙏 We will now prioritise the bug and address it appropriately.
This bug report has been assigned high priority to fix. If you wish to contribute a fix, please branch from master and submit your PR with the base set to master. Thanks!
Found a bug while working on the global node resolution.
If you try and disconnect a relationship based on an aliased field, the translate function doesn't implement the alias.
I think the issue boils down to the fact that the the
mapDbToProperty
function is not called when resolving a disconnect field. The where filter on a disconnect is ultimately resolved by thecreateRelationshipWhereAndParams
orcreateNodeWhereAndParams
functions, neither of which uses mapDbToProperty, whereas the translation function for connect where argscreateWhereAndParams
does.Type definitions
To Reproduce
Steps to reproduce the behavior:
Try to create a mutation where you connect a relationship by id, and disconnect all previous relationships that don't have that id.
Mutation
Arguments
Mutation
Arguments
Mutation
Arguments
Expected behavior
The mutation should connect Luke to the Empire and Disconnect him from the Rebels. But if you run the following cypher in the Neo4J browser, you'll see that he is actively managing both.
Screenshots
This is a similar call for the schema I'm working with. Notice that the property connect uses for the equality check is
_id
while the one used for disconnect is the non-aliased fieldid
The text was updated successfully, but these errors were encountered: