I would like to be able to access data from the database within an Action Handler in Hasura. Is the best approach:
- to make a GraphQL query to the API exposed by Hasura; or
- use a client, like Prisma, to read from the db directly?
I would like to be able to access data from the database within an Action Handler in Hasura. Is the best approach:
I'm not sure there is a best approach. Personally, I use the API exposed by Hasura in action handlers. I've chosen to do this because:
I have thought many times about your question though, because there is something a little odd about calling back into Hasura to handle a Hasura action. But the reasons mentioned above are substantial gains in my opinion, so I've stuck with this approach.