Skip to content

Extract aggregate query fields for nested associations into dedicated by field #490

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

Merged
merged 1 commit into from
May 29, 2024

Conversation

igdianov
Copy link
Collaborator

@igdianov igdianov commented May 28, 2024

Move all aggregate queries for nested aggregations into dedicated by field to improve schema definition and data fetching for further extension, i.e.

Before:

                query {
                  TaskVariables(
                    # Apply filter criteria
                    where: {name: {IN: ["variable1", "variable5"]}}
                  ) {
                    aggregate {
                      # Count by associated tasks
                      task {
                        by(field: status)
                        count
                      }
                    }
                  }
                }

After

                query {
                  TaskVariables(
                    # Apply filter criteria
                    where: {name: {IN: ["variable1", "variable5"]}}
                  ) {
                    aggregate {
                      # Count by associated tasks
                      by {
                        task {
                          by(field: status)
                          count
                        }
                      }
                    }
                  }
                }

@igdianov igdianov self-assigned this May 28, 2024
@igdianov igdianov merged commit 4c36f74 into master May 29, 2024
3 checks passed
@igdianov igdianov deleted the refactor-aggregate-by-associations-schema branch May 29, 2024 00:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant