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.

729 questions
19
votes
3 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
  • 32,576
  • 21
  • 101
  • 125
14
votes
2 answers

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
  • 645
  • 1
  • 6
  • 14
11
votes
3 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,787
  • 2
  • 13
  • 21
10
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
  • 4,770
  • 2
  • 38
  • 54
8
votes
3 answers

docker-compose Error: FileNotFoundError: [Errno 2] No such file or directory

I am trying to compose a Docker file with a YML file as below. version: '3.6' services: postgres: image: postgres:12 restart: always volumes: - db_data:/var/lib/postgresql/data environment: POSTGRES_PASSWORD:…
Harsha M V
  • 54,075
  • 125
  • 354
  • 529
8
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.…
davidaap
  • 1,569
  • 1
  • 18
  • 43
8
votes
2 answers

Hasura Error - GraphQL error: field "user_id" not found in type: 'projects_insert_input'

I'm trying to add a new project with a connected user assigned to a project but I continue to receive an error 'GraphQL error: field "user_id" not found in type: 'projects_insert_input'' Each project has a user_id column mandatory (I can add…
basic
  • 219
  • 6
  • 12
7
votes
1 answer

How to access Hasura session_variables in PostgreSQL triggers

I want to limit inserts into a PostgreSQL table department for individual users(business) using a trigger function. Each business should be able to create a maximum of 5 departments. I am trying to access Hasura session_variables also, which…
7
votes
1 answer

Hasura GraphQL how to group query by month and year?

Is it possible in GraphQL or Hasura to group the results by month or year? I'm currently getting the result list back as a flat array, sorted by the date attribute of the model. However, I'd like to get back 12 subarrays corresponding to each month…
7ball
  • 2,183
  • 4
  • 26
  • 61
7
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
  • 195
  • 1
  • 1
  • 9
7
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
  • 129
  • 1
  • 9
7
votes
2 answers

Sending a POST request to my RESTful API(Python-Flask), but receiving a GET request

I'm trying to send a trigger to a Zapier webhook in the form of a POST request containing JSON. It works fine if I just send the POST request through a local python script. What I want to do is create a RESTful API which makes the trigger to the…
Joel Kingsley
  • 81
  • 1
  • 2
  • 4
6
votes
1 answer

How do I use the React-Relay @appendNode directive with Hasura's generated functions/schema?

I am currently trying to create an interface wherein a user is able to append additional metadata descriptors to an object while in a modal and need to reflect the results of this append elsewhere on the page. I am using react-relay with Hasura…
6
votes
2 answers

no such column exists for PostgreSQL db in Hasura (Graphql) console when adding column via DBeaver

I just tested modifying a table in my PostgreSQL db through DBeaver and it seems to have broken the db when looking at the data from the Hasura (Graphql) console. I simply added a column from Dbeaver. In Hasura I get an error "no such column…
virtualbis
  • 397
  • 1
  • 14
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
  • 426
  • 4
  • 16
1
2 3
48 49