TutorialsCourses
Course Menu
Hasura For Beginners

Welcome to Hasura

Introduction

Hasura offers an instant GraphQL endpoint pointing at any PostgresSQL database. New databases are being added but we will focus on Postgres specifically. This course is going to focus on the basics of Hasura. Starting with how to get going locally. Building out the database using the Hasura console. Explaining the permission system. Finally creating subscriptions to complete our chat system. We'll also look at how authentication and JWTs work with Hasura and Actions.

This is not an exhaustive course for every Hasura feature, but it is a course that will take you from "WTF is Hasura?" to "Oh wow I'm going to use this for almost everything.". A simple glimpse into the power of Hasura opens up a lot of possibilities for many people. Whether it be simple projects, prototypes, internal products, Hasura offers everything you need.

Features

  • Role Based Access Control
  • Flexible Permission System
  • CRUD Operations out of the Box
  • Complex, and flexible querying language for querying for data
  • Subscriptions respecting permissions!
  • Extend functionality with SQL (like full text searching, arbitrary views, volatile functions as mutations)

Business Logic

Hasura provides a complex set of permission logic to enforce who can do what, and additionally with column presets you can insert data related to the user automatically. Sometimes though this isn't enough. Hasura offers 2 features that allow for any business logic you want.

This includes Actions which are HTTP POSTS to any arbitrary endpoint that is then stitched into the GraphQL schema as a mutation or query. The second is remote schemas. The remote schemas allow you to integrate other external GraphQL schemas. You can also just spin up your own custom GraphQL server (even serverless!) and integrate that. There are some benefits to the remote schema (like remote joins) but for the most part Actions are the way I prefer to extend Hasura and add business logic.

Regardless of remote schema, or action, you can write code that talks back to Hasura and avoid writing any SQL queries.