You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The spec explicitly mentions sorting by multiple fields is not supported. This seems like a fairly basic requirement -- when filtering by non-unique fields, adding a second field to sort by ensures consistent ordering. What's the thinking behind applying this limitation?
For what it's worth, GraphQL coerces non-array inputs into arrays for arguments that are lists. So making orderBy a list doesn't necessarily have to be a breaking change for existing schemas.
Given a schema like
type Query {
findNotes(orderBy: [OrderByInput!]): NoteResultList!
}
This is still valid:
{
findNotes(orderBy: { field: id }): {
items {
id
}
}
}
The value passed to the resolver will be [{ field: "id", order: "ASC" }].
The text was updated successfully, but these errors were encountered:
The spec explicitly mentions sorting by multiple fields is not supported. This seems like a fairly basic requirement -- when filtering by non-unique fields, adding a second field to sort by ensures consistent ordering. What's the thinking behind applying this limitation?
For what it's worth, GraphQL coerces non-array inputs into arrays for arguments that are lists. So making
orderBy
a list doesn't necessarily have to be a breaking change for existing schemas.Given a schema like
This is still valid:
The value passed to the resolver will be
[{ field: "id", order: "ASC" }]
.The text was updated successfully, but these errors were encountered: