For sort operations, given a field, GraphQL creates an enum of all fields (which accounts for up to three levels of nested fields) for a particular type, such as the following:
enum BlogFieldsEnum {
id
title
date
parent___id
# and so forth
}
This field is then combined with another enum containing an order (ASC
for ascending or DESC
for descending) into a sort input type:
input BlogSortInput {
fields: [BlogFieldsEnum]
order: [SortOrderEnum] = [ASC]
}
Leave a Reply