graphql icon indicating copy to clipboard operation
graphql copied to clipboard

Missing aggregate filter for union relation fields

Open Andy2003 opened this issue 3 years ago • 4 comments

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 avatar Jan 18 '22 13:01 Andy2003

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

Andy2003 avatar Jan 21 '22 13:01 Andy2003

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:

  • Type definitions
  • Resolvers
  • Query and/or Mutation (or multiple) needed to reproduce

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 avatar Feb 21 '24 11:02 neo4j-team-graphql

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

darrellwarde avatar Feb 21 '24 11:02 darrellwarde

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.

neo4j-team-graphql avatar Feb 22 '24 16:02 neo4j-team-graphql