neo4j / graphql

A GraphQL to Cypher query execution layer for Neo4j and JavaScript GraphQL implementations.
https://neo4j.com/docs/graphql-manual/current/
Apache License 2.0
508 stars 149 forks source link

Nested deletes on related unions errors #3455

Open Liam-Doodson opened 1 year ago

Liam-Doodson commented 1 year ago

Type definitions

type PersonOne {
  name: String
}

type PersonTwo {
  nameTwo: String
}

union Person = PersonOne | PersonTwo

type Movie {
  id: ID
  actors: [Person!]!
    @relationship(type: "ACTED_IN", direction: IN)
}

Test data

No response

Steps to reproduce

Execute the following query:

mutation {
  updateMovies(
    update: {
      actors: {
        PersonOne: { delete: { where: { node: { name: "someName" } } } }
      }
    }
  ) {
    info {
      nodesCreated
      nodesDeleted
    }
  }
}

What happened

The following error in response:

{
  "errors": [
    {
      "message": "Cannot read properties of undefined (reading 'name')",
      "locations": [{ "line": 2, "column": 3 }],
      "path": ["updateMovies"]
    }
  ],
  "data": null
}

Expected behaviour

No error

Version

3.20.1

Database version

N/A

Relevant log output

No response

neo4j-team-graphql commented 1 year ago

Many thanks for raising this bug report @Liam-Doodson. :bug: We will now attempt to reproduce the bug based on the steps you have provided.

Please ensure that you've provided the necessary information for a minimal reproduction, including but not limited to:

If you have a support agreement with Neo4j, please link this GitHub issue to a new or existing Zendesk ticket.

Thanks again! :pray:

neo4j-team-graphql commented 1 year ago

Many thanks for raising this bug report @Liam-Doodson. :bug: We will now attempt to reproduce the bug based on the steps you have provided.

Please ensure that you've provided the necessary information for a minimal reproduction, including but not limited to:

If you have a support agreement with Neo4j, please link this GitHub issue to a new or existing Zendesk ticket.

Thanks again! :pray:

neo4j-team-graphql commented 1 year ago

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