Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update ... Delete operation fails for unions #5599

Closed
angrykoala opened this issue Sep 27, 2024 · 1 comment · Fixed by #5606
Closed

Update ... Delete operation fails for unions #5599

angrykoala opened this issue Sep 27, 2024 · 1 comment · Fixed by #5606
Labels
bug Something isn't working confirmed Confirmed bug

Comments

@angrykoala
Copy link
Member

Given the following typedefs:

type Movie @node {
    title: String!
    actors: [Actor!]! @relationship(type: "ACTED_IN", direction: IN)
}

type LeadActor @node {
    name: String!
    actedIn: [Movie!]! @relationship(type: "ACTED_IN", direction: OUT)
}

type Extra @node {
    name: String
    actedIn: [Movie!]! @relationship(type: "ACTED_IN", direction: OUT)
}

union Actor = LeadActor | Extra

The following query:

mutation UpdateMovies {
  updateMovies(
    update: {
      actors: {
        LeadActor: [{ delete: [{ where: { node: { name: "Actor1" } } }] }]
      }
    }
  ) {
    movies {
      title
    }
  }
}

Should delete all LeadActors named "Actor1" connected to a move. However, it fails with the following error:

"Cannot read properties of undefined (reading 'name')"

This seems to be an issue with unions, as the equivalent query with concrete types does not fail

@angrykoala angrykoala added bug Something isn't working confirmed Confirmed bug labels Sep 27, 2024
@neo4j-team-graphql
Copy link
Collaborator

We've been able to confirm this bug using the steps to reproduce that you provided - many thanks @angrykoala! 🙏 We will now prioritise the bug and address it appropriately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working confirmed Confirmed bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants