Skip to content

Aggregate filter is wrongly generated for non-List relationship #2969

@darrellwarde

Description

@darrellwarde

Type definitions

type Post {
    content: String!
    author: User! @relationship(type: "HAS_AUTHOR", direction: OUT)
}

type User {
    id: ID!
    name: String!
    posts: [Post!]! @relationship(type: "HAS_AUTHOR", direction: IN)
}

Test data

No response

Steps to reproduce

  1. Generate a schema using the above type definitions

What happened

The following input type will be generated:

input PostWhere {
    AND: [PostWhere!]
    NOT: PostWhere
    OR: [PostWhere!]
    author: UserWhere
    authorAggregate: PostAuthorAggregateInput
    authorConnection: PostAuthorConnectionWhere
    authorConnection_NOT: PostAuthorConnectionWhere
    author_NOT: UserWhere
    content: String
    content_CONTAINS: String
    content_ENDS_WITH: String
    content_IN: [String!]
    content_NOT: String @deprecated(reason: \\"Negation filters will be deprecated, use the NOT operator to achieve the same behavior\\")
    content_NOT_CONTAINS: String @deprecated(reason: \\"Negation filters will be deprecated, use the NOT operator to achieve the same behavior\\")
    content_NOT_ENDS_WITH: String @deprecated(reason: \\"Negation filters will be deprecated, use the NOT operator to achieve the same behavior\\")
    content_NOT_IN: [String!] @deprecated(reason: \\"Negation filters will be deprecated, use the NOT operator to achieve the same behavior\\")
    content_NOT_STARTS_WITH: String @deprecated(reason: \\"Negation filters will be deprecated, use the NOT operator to achieve the same behavior\\")
    content_STARTS_WITH: String
}

The authorAggregate field is totally irrelevant in this scenario.

Expected behaviour

The field not to be present.

Version

3.17.0

Database version

5.4

Relevant log output

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingconfirmedConfirmed bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions