I am new to Hasura, and I have questions about how to implement own business logic by utilising the hasura framework.
I am starting a e-commerce project and plan to use graphql. I want to minimise the code by applying some tools, and hasura is my first choice so far.
Hasura did a great job to convert models into running graphql endpoints, and those generated CRUD functions will save a lot of time.
However, how about the other non-CRUD logics, like sign in
, place order
, etc.
Per my knowledge, Hasura has two ways to implement own business logic:
- Actions: it is very handy if the logic exists in some existing REST API
- Remote Schema: stitching another schema into own
But, IMO, for these two ways, I cannot take any advantage from hasura.
What I mean is, e.g., sign in
, given user name and password, I need to search in the user
table, if success then I need to generate token and save in the session table.
It seems I have to query user
table by myself using other framework and create record to session
table by myself. Ideally, I hope I can take advantage of the hasura framework cos hasura actually is be able to.
I am not sure if I miss anything for hasura to support this common case.
Thank you, Ron