GraphQLize Update (#2) - Supports Sorting, Filtering & MySQL Boolean Types
Hello World,
GraphQLize is one month old now ๐, and it is getting better day by day. Almost 50% of the planned features are complete ๐.
As usual in this blog post, I am going to share what's new in GraphQLize and what is in the pipeline for the next two weeks.
Here we go!
Sorting
GraphQLize now enables sorting the query results using the orderBy
argument. By default, you can use any of the table columns to sort the query results. In future, we can control this behaviour.
If you'd like to sort it in descending order, replace ASC
with DESC
.
We can sort by multiple columns as well,
GraphQLize also supports sorting nested objects.
note
Currently, sorting nested objects in MySQL is not supported. in a later release.
Filtering
Filtering is another critical feature that was released in the last iteration. Like orderBy
in sorting, we have the where
argument using which we can specify the filter
condition.
Here are some of the examples of using eq
, in
, isNull
and between
filter conditions.
For the detailed set of supported filter conditions, you can check out this documentation.
We can filter the nested objects also.
MySQL Boolean Data Type Support
The last feature that was developed as part of the previous iteration is the support for MySQL boolean
data type.
GraphQLize treats the column types BIT(1)
and TINYINT(1)
as the Boolean
GraphQL scalar type.
Here is an example of using it in a filter condition to filter only active
customers.
What's Next?
I am planning to take a short break for two days to sustain my progress and energy level. Then, I am going to work on the following issues for the next two weeks.
-
Supporting , and operators in the filter conditions.
-
Ability to filter based on the nested object's fields -
-
Filter based on the existence of nested objects -
I am keeping this iteration light as I may not be able to spend some good quality time outside my work hours. In case, if I am free, I would take some more features around filtering. Let's see how it goes ๐ค.
You can keep track of the progress by
- Following the
- Joining
- Subscribing to
โญ๏ธ If you like GraphQLize, give it a star on ! โญ๏ธ
That's all!
Cheers,
Tamizh