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

groupBy item in result set even when not requested #1582

Closed
fredcarle opened this issue Jun 19, 2023 · 0 comments · Fixed by #1500
Closed

groupBy item in result set even when not requested #1582

fredcarle opened this issue Jun 19, 2023 · 0 comments · Fixed by #1500
Labels
area/query Related to the query component bug Something isn't working

Comments

@fredcarle
Copy link
Collaborator

When we query with a groupBy, the groupBy item is returned in the result set even though it wasn't explicitly requested. This goes agains the graphql specs that states that the shape of the response must match that of the request. https://spec.graphql.org/October2021/#sec-Language.Fields, https://spec.graphql.org/October2021/#sec-Overview

query {
  Users(groupBy: [Name]) {
    _group {
      Age
    }
  }
}

returns

{
  "Name": "Alice",
  "_group": [
    {"Age": 19}
  ]
}

but should return

{
  "_group": [
    {"Age": 19}
  ]
}
@fredcarle fredcarle added bug Something isn't working area/query Related to the query component labels Jun 19, 2023
jsimnz added a commit that referenced this issue Jun 27, 2023
## Relevant issue(s)

Resolves #490 
Resolves #1582 (indirectly)

## Description

This is a reduced version of #491. It takes a very different approach,
and tries to keep as much of the existing Fetcher structure as possible.

Basically, this will try to eagerly ignore documents that don't pass the
given filter at the fetcher level. This means we can apply various
optimizations then if the filter was applied at the scanNode level like
before.
shahzadlone pushed a commit to shahzadlone/defradb that referenced this issue Feb 23, 2024
## Relevant issue(s)

Resolves sourcenetwork#490 
Resolves sourcenetwork#1582 (indirectly)

## Description

This is a reduced version of sourcenetwork#491. It takes a very different approach,
and tries to keep as much of the existing Fetcher structure as possible.

Basically, this will try to eagerly ignore documents that don't pass the
given filter at the fetcher level. This means we can apply various
optimizations then if the filter was applied at the scanNode level like
before.
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

Successfully merging a pull request may close this issue.

1 participant