tags
POPULAR

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! 👇👇👇

Close

Get Started with GraphQL Now

Hasura Cloud gives you a fully managed, production ready GraphQL API as a service to help you build modern apps faster.

Sezgi Ulucam

Sezgi Ulucam

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

Read More

Ready to get started?
Start for free on Hasura Cloud or you could contact our sales team for a detailed walk-through on how Hasura may benefit your business.
Get monthly product updates
Sign up for full access to our community highlights, new features, and occasional baby animal gifs! Oh, and we have a strict no-spam rule. ✌️