-
-
Save PericlesTheo/534c2ed18c7ca2ed3e63672c1c3c64df to your computer and use it in GitHub Desktop.
Definition of query language
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type Query = { | |
search?: string, | |
filter_group: FilterGroup, | |
pagination: Pagination, | |
sort: Sort | |
} | |
type FilterGroup = { | |
conditional: Conditional, | |
expressions: Array<Filter | FilterGroup> | |
} | |
enum Conditional { | |
And = "and", | |
Or = "or" | |
} | |
type Filter = { | |
property: string, | |
operator: Operator, | |
values: Array<string | number | boolean> | |
} | |
enum Operator { | |
Eq = "equal", | |
NotEq = "not_equal", | |
Lte = "lte", | |
Lt = "lt" , | |
Gt = "gt", | |
Gte = "gte", | |
Exist = "exist", | |
NotExist = "not_exist", | |
In = "in", | |
NotIn = "not_in" | |
} | |
type Sort = { | |
property: string, | |
direction: Direction | |
} | |
enum Direction { | |
Asc = "asc", | |
Desc = "desc" | |
} | |
type Pagination = { | |
page: number, | |
perPage: number | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment