Closed bbingCGI closed 2 years ago
Being as changing order from an object descriptor to an array, that would be a breaking change. Perhaps adding a operation like the and
operation in the filter convention would keep it from breaking existing functionality. Something like by
?
query {
people (order: { by: [
{ demographic: { gender: ASC } }
{ address: { state: ASC } }
{ demographic: { age: ASC } }
]}) {
lastName
demographic {
gender
age
}
address {
city
state
}
}
}
order is already an array, so you can do
query {
people(
order: [
{ demographic: { gender: ASC } }
{ address: { state: ASC } }
{ demographic: { age: ASC } }
]
) {
lastName
demographic {
gender
age
}
address {
city
state
}
}
}
Is there an existing issue for this?
Describe the bug
Ordering requires a sequential narrative presently, such as "order by Last Name, then by First Name, then by Age". Because of this, if a query needs to order by parent and child properties where the child's properties are not back-to-back, the dreaded "There can only be one input field named Child" will appear.
Steps to reproduce
I've created a repository to pull down and demonstrate the following example.
Sample query
Relevant log output
Additional Context?
Note that this only applies to order. Filters don't care about what order they are entered and can be grouped by child objects.
A possible workaround would be to use the array option like the where's
and
andor
can use:Product
Hot Chocolate
Version
12.5.0