I'm using GraphQL in Golang with gqlgen and Bun as ORM.
I'm using DDD and Clean architecture, meaning that I'm avoiding one-size-fits-all/lock-in solutions like Hasura, Postgraphile, DGraph and everything like that; I can (and I eventually will, no hurry) write and organize my code in such a way to achieve their features.
For now I'm wondering about complex queries with filters like: AND, OR, NOT (better described here).
Right now I need to think/write/test code all by myself and this certainly does not speed up production of the software I want to write.
Also, my code will almost certainly be slow, buggy and possibly all wrong as soon as I realize that I will need something extra for this feature.
After all, this is true for all software and is one of the reasons why open source was born.
After some research I noticed there are two approaches to solving the problem of GraphQL data filtering:
create input types that contain the model fields but also logical comparators as a possible value (like Hasura, Postgraphile and others do)
QUESTIONs
What do you think if in Bun we already offer some facilities to avoid manually writing the code for this problem using .WhereGroup(), .Where() and .WhereOr()?
Or at least we can update the docs with simple but also complex examples
This issue has been automatically marked as stale because it has not had activity in the last 30 days. If there is no update within the next 7 days, this issue will be closed.
I'm using GraphQL in Golang with gqlgen and Bun as ORM.
I'm using DDD and Clean architecture, meaning that I'm avoiding
one-size-fits-all/lock-in
solutions like Hasura, Postgraphile, DGraph and everything like that; I can (and I eventually will, no hurry) write and organize my code in such a way to achieve their features.For now I'm wondering about complex queries with filters like:
AND
,OR
,NOT
(better described here).Right now I need to think/write/test code all by myself and this certainly does not speed up production of the software I want to write.
Also, my code will almost certainly be slow, buggy and possibly all wrong as soon as I realize that I will need something extra for this feature.
After all, this is true for all software and is one of the reasons why open source was born.
After some research I noticed there are two approaches to solving the problem of GraphQL data filtering:
create all possible combinations for each field of the model (this is how ent behaves and other users suggest)
create input types that contain the model fields but also logical comparators as a possible value (like Hasura, Postgraphile and others do)
QUESTIONs
.WhereGroup()
,.Where()
and.WhereOr()
?