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
511 stars 150 forks source link

Missing aggregate filter for union relation fields #810

Open Andy2003 opened 2 years ago

Andy2003 commented 2 years ago

Given the Schema:

type Movie {
    title: String!
    isan: String! @unique
}
type Series {
    title: String!
    isan: String! @unique
}
union Production = Movie | Series
interface ActedIn @relationshipProperties {
    screenTime: Int!
}
type Actor {
    name: String!
    actedIn: [Production!]! @relationship(type: "ACTED_IN", direction: OUT, properties: "ActedIn")
}

The following ActorWhere is generated:

input ActorWhere {
  AND: [ActorWhere!]
  OR: [ActorWhere!]
  actedInConnection: ActorActedInConnectionWhere
  actedInConnection_NOT: ActorActedInConnectionWhere
  name: String
  name_CONTAINS: String
  name_ENDS_WITH: String
  name_IN: [String]
  name_NOT: String
  name_NOT_CONTAINS: String
  name_NOT_ENDS_WITH: String
  name_NOT_IN: [String]
  name_NOT_STARTS_WITH: String
  name_STARTS_WITH: String
}

see also: https://github.com/neo4j/graphql/blob/dev/packages/graphql/tests/schema/connect-or-create-unions.test.ts#L330-L345

I would expect the additional fields on this input type:

  actedIn: ProductionWhere
  actedInAggregate: ActorActedInAggregateInput
  actedIn_NOT: ProductionWhere
Andy2003 commented 2 years ago

Same question for interface relationships.

I would expect the following fields on an relations of type interface as well:

actedIn: ProductionWhere
actedInAggregate: ActorActedInAggregateInput
actedIn_NOT: ProductionWhere
neo4j-team-graphql commented 9 months ago

Many thanks for raising this bug report @Andy2003. :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:

darrellwarde commented 9 months ago

From the example above, actedInAggregate is all that's missing from the input above now in the 5.0.0 branch.

neo4j-team-graphql commented 9 months ago

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