Aggregation in pagination
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 3.5k
- Forks
- 468
- Avg merge
- 3h 9m
- Merged PRs (30d)
- 2
Description
I will gladly provide a PR for this issue
What problem does this feature proposal attempt to solve?
There's no easy way to get different aggregations of columns or relations, without declaring each of them separately.
Which possible solutions should be considered?
The should be two new types; ColumnAggergation and RelationAggregation. And the generated input creates one for each column and relation, containing the relevant possible aggregations. Also to make sure it doesn't impact performance, the aggregations should be preformed only when there's a request for it.
Request Example
products{
pagintorInfo {
total
}
data {
price
purchases {
id
}
}
aggregation {
price {
min
max
sum
}
purchases {
total
}
}
}
Generated Type
type ProductPagination
{
paginatorInfo: PaginatorInfo!
data: [Product!]!
aggregation : ProductAggregation!
}
type ProductAggregation
{
price: ColumnAggregation
purchases : PurchaseRelationAggregation
}
type PurchaseAggregation
{
payed: ColumnAggregation
}
type PurchaseRelationAggregation
{
columns: PurchaseAggregation
aggregation: RelationAggregation
}
type ColumnAggregation
{
count: Int
sum: Int
min: Int
max: Int
average: Int
mean: Int
}
type RelationAggregation
{
count: Int
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No files, tests, or entry points are named in the issue. Start by locating the pagination schema generation and resolver paths, then compare them with the requested GraphQL request and generated types; done means requested column and relation aggregations are available only when queried without degrading pagination performance.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- graphql, laravel, php
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100