Data Models & Authorization

  • TickTry out Hasura’s Data API and Authorization features through examples
  • TickExplore Database schemas, relationships and permissions
  • TickDemos of database specific concepts like views and functions.


  • Core ConceptsCore Concepts
  • Intermediate ImplementationsIntermediate Implementations
  • Sample Data ModelsSample Data Models
AllAll Integrations
Default img
Views: Group By & Aggregate
Views can be used to expose the results of a custom query as a virtual table. This example demonstrates grouping by a column and aggregating.
Default img
Functions: Multiple Column Text Search
Custom functions are ideal solutions for retrieving some derived data based on some custom business logic that requires user input to be calculated. This is an example of using a custom function to create a text search across multiple columns.
Default img
Enum: Reference Table
Using foreign-key references to a single-column table allows us to represents an enum using ordinary relational database concepts using Hasura.
Default img
Relationships: One-to-One
A one-to-one relationship between two tables can be established via a unique foreign key constraint and tracked using Hasura.
Default img
Relationships: One-to-Many
A one-to-many relationship between two tables can be established via a unique foreign key constraint and tracked using Hasura.
Default img
Relationships: Many-to-Many
A many-to-many relationship, established by creating a table & adding foreign-key constraints from it to the original tables, can be tracked using Hasura.
Default img
Permissions: Row-Level (Basic)
Row-level permissions can be set based on a user's role or any session variables.
Default img
Permissions: Column-Level Filtering
Column-level permissions determine access to columns that are accessible by the user's role.
Default img
Functions: Fuzzy-Match Search
This is an example of a fuzzy-match search function across multiple columns. This schema is installable through Hasura Console.
Default img
Functions: Accessing Session Variables
Create a function with an argument for session variables and track it using your Hasura API.
Default img
Location Tracking
A fully-functioning location tracking model to build a realtime GraphQL API
Default img
An ecommerce model from the Hasura Super App
Default img
The Chinook data model represents a digital media store, including tables for artists, albums, media tracks, invoices and customers.
Default img
The Sakila database is a nicely normalised database modelling a DVD rental store.
Default img
Gatsby + Contentful + Auth0
Building a Music Playlist App with Gatsby, Contentful and Hasura Remote Joins
Default img
Next.js Incremental Static Regeneration
Regenerate Next.js Pages On-demand (ISR) with Hasura Table Events
Default img
Next.js Serverless JWT Auth
Add Authentication and Authorization to Next.js 8 Serverless Apps using JWT and GraphQL
Default img
Realtime Collaborative Todo App
Build a real-time to-do app backend with GraphQL APIs, secured using JSON Web Tokens.
Default img
Realtime Chat
Build a realtime chat app with GraphQL Subscriptions.
Default img
Serverless ETL
Build an ETL process using event triggers on Hasura.
Default img
Push Notifications
Push notifications using Hasura Event Triggers and FCM
Default img
Multiplayer Tic-Tac-Toe
Multiplayer Tic Tac Toe with GraphQL
Default img
WhatsApp Clone
Building a WhatsApp Clone with GraphQL, React Hooks and TypeScript