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

Count aggregate errors on _group with parent filter #2915

Open
AndrewSisley opened this issue Aug 16, 2024 · 0 comments
Open

Count aggregate errors on _group with parent filter #2915

AndrewSisley opened this issue Aug 16, 2024 · 0 comments
Labels
area/query Related to the query component bug Something isn't working

Comments

@AndrewSisley
Copy link
Contributor

AndrewSisley commented Aug 16, 2024

Schema:

type PlayerAction {
  metadata: JSON
  deleted: Boolean
  action: Action @relation(name: "actionPlayerActions") // one-many
  player: Player @relation(name: "playerPlayerActions") // one-many
  playerRewards: [PlayerActionToPlayerReward] @relation(name: "playerActionPlayerRewards")
  createdAt: DateTime
}

Query:

query  {
  PlayerAction( 
    filter: { player_id: { _eq: "bae-d76c3c25-2558-512d-82e6-012abea5d0ee" } }
    groupBy: [action_id] 
  ) 
  {
    action_id
    _count(_group: {})
  }
}

Error (ln 439 of planner.go):

"unexpected type. Property: plan, Actual: *planner.multiScanNode"

We appear to have no tests for _count(_group: {}) with filters on the top level query (we have some with filters on the aggregate). Database was populated when the error was found, although the error suggests that that is irrelevant and I guess that this would be reproducible in an empty db.

Probably affects the other aggregates too.

Seems likely that this is a very old bug that will have been reproducible for a long time.

@AndrewSisley AndrewSisley added bug Something isn't working area/query Related to the query component labels Aug 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/query Related to the query component bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant