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

Array methods do not raise an error on relationship properties. #5766

Open
MacondoExpress opened this issue Nov 8, 2024 · 1 comment
Open
Labels
bug Something isn't working confirmed Confirmed bug

Comments

@MacondoExpress
Copy link
Contributor

Describe the bug
The array methodz _PUSH/ _POP do not raise an error when the array is not initialized; this happens only on relationship properties, while a proper error is raised on node properties.

Type definitions

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

type ActedIn @relationshipProperties {
    stuffs: [Int!]
}

type Actor {
    name: String
    movies: Movie! @relationship(type: "ACTED_IN", direction: OUT, properties: "ActedIn")
}

To Reproduce
The below mutation does not raise an error:

mutation MyMutation {
  updateMovies(update: { actors: { update: { edge: { stuffs_PUSH: 10 } } } }) {
    movies {
      actors {
        name
      }
    }
  }
}

The following will raise an error:

mutation MyMutation {
  updateMovies(update: { stuffs_PUSH: 1 }) {
    movies {
      actors {
        name
      }
    }
  }
}

Error

{
  "errors": [
    {
      "message": "Failed to invoke function `apoc.util.validatePredicate`: Caused by: java.lang.RuntimeException: Property stuffs cannot be NULL",
      "locations": [{ "line": 2, "column": 3 }],
      "path": ["updateMovies"]
    }
  ],
  "data": null
}

Expected behavior
A consistent behavior with an error that is raised, currently one mutation does not raise an error and at the same time, the property is not correctly mutated.

System (please complete the following information):

@MacondoExpress MacondoExpress added bug Something isn't working confirmed Confirmed bug labels Nov 8, 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 @MacondoExpress! 🙏 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

No branches or pull requests

2 participants