The filtering looks mostly the same as the inital outline with some minor naming and null-able changes:
# Filter whiskey using a comparator and a field value.
input Filter {
comp: Comparator,
field: Field!
}
# What to compare against
# Only the first one of these will be used for each given filter
input Field {
title: String, # Filter by whiskey name (does not need comparator)
avgScore: Float, # Avg whiskey score
attribute: InputAttribute # Filter by an attribute
}
input InputAttribute{
id : Int! # Attribute category ID
avgScore: Float! # Attribute average score value
}
enum Comparator {
LT, # Less than
GT, # Greater than
LE, # Less than or equal
GE, # Greater than or equal
EQ # Equals
}
An example using the filters to get every whiskey that has malt in title and has an average rating of Greater Than 0.4 (2 stars). The resulting whiskeys are sorted by PRICE in reverse/increasing order:
This PR includes:
getWhiskeys
graphql query function.reverse
propertyThe filters where initially outlined by @Neelzee in the related issue.
This implementation looks like:
Where Sort is defined by:
The filtering looks mostly the same as the inital outline with some minor naming and null-able changes:
An example using the filters to get every whiskey that has
malt
in title and has an average rating of Greater Than0.4
(2 stars). The resulting whiskeys are sorted byPRICE
inreverse
/increasing order:Paging remains unchanged with default values
{page: 0, size: 10}
, when not given as input.