Questions tagged [hasura]

Hasura is an open-source tool that provides instant realtime GraphQL APIs and webhook event triggers on Postgres.

Hasura

Hasura provides a scalable and performant GraphQL API out of the box. It can run up to 1mio concurrent subscriptions, scaling vertically & horizontally seamlessly. It comes with a comprehensive permission system that allows you to enforce fine-grained access control. Authentication can be integrated using webhooks or JWT. Hasura also allows you to extend your GraphQL API with business logic through remote schemas (other GraphQL servers), actions (REST APIs) or even custom functions in Postgres. Event triggers make it possible to trigger business logic that is running in serverless functions.

Hasura runs in a Docker container and can be deployed to any cloud provider that runs Docker, or it can be run locally. Use Hasura migrations to migrate from your development environment to production, as well as for version control.

Tech stack

  • The Hasura server which serves the GraphQL API is written in #Haskell. It takes declarative configuration.
  • The Hasura console allows you to configure the Hasura server, manage your Postgres database and test your APIs. It's built with #React.
  • The Hasura CLI that is used for the CI/CD and migration workflows is written in #Go.

Useful links

Initial release

3rd July 2018.

416 questions
9
votes
2 answers

How to apply a Hasura `where` filter only if a variable is not null?

I have a query like this: query getUsers ($setId: Int) { user(where: { user_sets: { set_id: { _in: [$setId] } } }) { id name status user_sets { set { name } } # more fields... } } What I'm looking…
user56reinstatemonica8
  • 27,132
  • 16
  • 87
  • 109
9
votes
2 answers

How to upload files or images on hasura graphql engine

Example: upload file to server and save resulting path to the database, only authenticated users should be able to upload files How to implement this?
srghma
  • 3,399
  • 2
  • 23
  • 42
7
votes
2 answers

How do I take a postgres data backup on Hasura

I want to take a pg_dump of my data from HasuraDB to my local machine. What is the recommended way to do this ?
Jackspicer
  • 1,597
  • 2
  • 11
  • 20
6
votes
1 answer

Hasura: Allow users to not vote for their own post

I have three models User, Post, Vote I tried to create a role-based authorization where the author (the user who creates a post/blog) can't vote for their own post/blog. To identify users, I used Hasura session variables X-Hasura-User-Id.…
falamiw
  • 239
  • 1
  • 10
6
votes
1 answer

How to update dynamically of multiple rows in one table using Graphql

I am new to graphql hasura and i'm having this issue how to update multiple rows in one table, because usually i update only one row per table. i want to update multiple rows in a dynamic way I have for example existing rows data. id: 1, name:…
rj.learn
  • 441
  • 1
  • 5
  • 8
6
votes
0 answers

How to implement basic login with Hasura on Heroku?

I'm completely new to web development and have never implemented anything that needs some kind of authentication before - basically, where the user can sign up, log in and log out. I've stumbled across Hasura, a GraphQL server over Postgres and…
Mosbas
  • 119
  • 8
5
votes
0 answers

Starting Hasura GraphQL engine Docker image

I'm trying to get started with Hasura GraphQL engine running locally on OSX in Docker and connecting to an existing database but I am having trouble finding the container or the Hasura console. Here's what I have: docker -v Docker version 19.03.5,…
burntsugar
  • 54,120
  • 21
  • 51
  • 77
5
votes
1 answer

Hasura GraphQL Endpoint behind Apollo Federated Gateway

Has anyone successfully placed a Hasura GraphQL endpoint, behind an Apollo Federated Gateway? I know Hasura wants to act as the point of federation but I would rather not do that...current thought is to create an apollo server with a remote schema…
T.Davidson
  • 79
  • 7
5
votes
1 answer

How to update data provider headers dynamically in hasura react admin?

I'm trying to do an application that needs authentication using react-admin and the hasura data provider, i need to change the headers of the after the login success. Right now, the headers are only updated when i reload the page, otherwise, this…
Mihael Zamin
  • 155
  • 1
  • 1
  • 8
5
votes
1 answer

How to filter GraphQL nested array on field returning in same query's response? Or how to create GraphQL relationship on more than one field?

So I'm using GraphQL with Hasura and Apollo in my Android application. The application is related to sports, it stores multiple score sets of each player in multiple segments of a match. My Postgres database has following tables (with concerned…
5
votes
2 answers

How do I import a .csv file into my Hasura PostgreSQL database?

I have data in a .csv file that I want to import into my Hasura cluster's PostgreSQL database instance. What's the best way to do this?
Kartikey
  • 51
  • 2
4
votes
2 answers

Check for empty arrays in Hasura

I have the following Query: query { table1(where: {table2: {id: {}}}) { id } } There is a relationship between table1 and table2 via a foreign key. That is, in table2 I have a column named table1_id and so I can access table2 from table1.…
darmendarizp
  • 873
  • 1
  • 7
  • 19
4
votes
3 answers

AAD B2C: Output a nested JSON object in a JWT for Hasura

We are using Hasura to provide our GraphQL API to consumers. Currently we use Auth0 to authenticate users, but we would like to migrate to Azure AD B2C. A requirement of JWT security with Hasura is using the "https://hasura.io/jwt/claims" namespace…
Dave
  • 43
  • 1
  • 6
4
votes
2 answers

Use hasura with Google Cloud Run and Google Cloud SQL

The docs describe that hasura needs the postgres connection string with the HASURA_GRAPHQL_DATABASE_URL env var. Example: docker run -d -p 8080:8080 \ -e HASURA_GRAPHQL_DATABASE_URL=postgres://username:password@hostname:port/dbname \ …
wiesson
  • 5,029
  • 4
  • 32
  • 55
4
votes
1 answer

What is the best and proper way to user Hasura as a Data Access Layer

I want to use Hasura only as a Data Access Layer behind a NestJs GraphQL server and keep all the benefit of Hasura especially the real time feature with subscriptions. The idea is to build a more customised API and handle all the business logic…
a__t
  • 41
  • 1
  • 1
1
2 3
27 28