tags

Hasura FAQ: What are the best practices? (Part 1)

06 March, 2020 | 2 min read

Have you been wondering about best practices with Hasura? Here’s a quick rundown of some of our recent FAQ’s.

What's the best practice for managing business logic?

Actions are the new hotness for business logic. Check out:

Other approaches for custom business logic:

Our blog post on all of the above

Is there a way to prevent GraphQL queries from becoming a pile of strings?

Sounds like you’re looking for a fluent GraphQL client. We wrote about this recently: Fluent GraphQL clients: how to write queries like a boss

These clients give you the ability to write queries as objects instead of strings. Some of them also integrate with TypeScript and eliminate duplicate data definitions.

Hasura migrations make managing environments easy. Check out:

I want to have my own custom signup flow. What’s the best way to achieve this?

Actions allow you to run business logic before executing a mutation. With an action, you can call an HTTP webhook (a REST endpoint or a serverless function) that talks to your auth provider, sign up the user with the provider, and save the user to your database afterwards. And here’s the kicker: Hasura provides a codegen that generates the handler code for you.

Also, check out this guide on creating a GraphQL API for Notion with Hasura Actions.

I don't see Actions on my console. How do I go about enabling it?

Update your Hasura GraphQL engine to the latest stable version.


That’s it for now. Do you have any burning questions regarding best practices with Hasura? Ask us in the comments! 👇👇👇

Webinar: Instant streaming APIs on Postgres, with built-in auth
View Recording
Hasura Con
The Hasura User Conference | June 28 - 30, 2022
New Product Announcements
View Recordings

Sezgi Ulucam

Sezgi Ulucam

Developer Advocate 🥑 @ Hasura | Front-End Dev | Baker | Dancer | Massage Therapist | WFR

Read More

Subscribe IlluSubscribe Illu

Monthly product updates in your inbox. No spam.

Loading...