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
0
votes
1 answer

How to handle a multiple requests in Hasura graphql and Netlify?

I am developing a reservation system using Flutter, Hasura graphql, and Postgres DB. Suppose my database has two main tables, "Operation" and "Ticket" "Operation" : "id", "operation_date", "seat_available". "Ticket" : "id", "seat_no",…
Alpha9
  • 101
  • 7
0
votes
0 answers

Invariant Violation: Can't find field XXX when updating apollo after a mutation

I try to update the cache of my list of needs that are inside a project after a mutation on 1 of the needs. But I get a Invariant Violation. First is important to know how I load my project. These is like the following: projects(where: { id: { _eq:…
Sven Z
  • 183
  • 1
  • 10
0
votes
1 answer

Graphql query is firing every time the page is loading. How to save in cache?

I'm having a website where I show different kinds of projects to the user. I'm using Hasura, NextJS and Apollo to make this happen. The problem I have now is that every time I come back to the home page (where I show my projects) the query is…
Sven Z
  • 183
  • 1
  • 10
0
votes
0 answers

How can I expose a postgres instance on a DO container using Hasura and Nextauth?

I'm using Hasura's 'one-click' deploy to Digital Ocean. The postgres instance works great, but I'm using NextAuth.js to authenticate users. The postgres instance isn't accessible via Nextauth. This is my docker-compose file: version:…
0
votes
1 answer

Need guidance creating parent - child relationship in database

There are a number of questions related to parent/child and many-to-many relationships, but I couldn't quite find one that seemed to make sense for my needs. I have a database of "samples", let's just consider it some kind of goop in a bucket. Each…
tdpu
  • 400
  • 3
  • 12
0
votes
1 answer

Can I make variables optional in a GraphQL query?

I have a query that includes a variable $filter which is a string. This variable is only relevant if the user has said they want to filter the results. If user doesn't filter, I want all results back that meet the criteria. Is there a way to omit…
Ray Kanani
  • 261
  • 1
  • 3
  • 8
0
votes
1 answer

initPayload from SocketClientConfig is not accepting Json-like data

Describe the bug I'm getting the following error message The argument type 'Map>' can't be assigned to the parameter type 'Future Function()'. for initPayload parameter at this code: static final WebSocketLink…
0
votes
1 answer

Check if input is in range. HASURA - GRAPHQL

I would like to check if a number is in a specific range dynamically. For example i have a table like: id value age_range 1 a 3-7 2 b 7-10 3 c 3-7 4 d 0-3 if the age of the user is 5, i would like to retrieve all rows where…
ppichier
  • 1,108
  • 1
  • 16
  • 21
0
votes
0 answers

Hasura: Convert object array to number array

I have a query that looks like this: query ($email: String!) { users(where: {email: {_eq: $email}}, limit: 1) { id email name clients { id } } } and when executed returns…
Get Off My Lawn
  • 34,175
  • 38
  • 176
  • 338
0
votes
1 answer

How to simplify Hasura's tracked relationship query responses?

Curious if I constructed and tracked this m2m relationship correctly. Seems strange that every object in those arrays are named "user": {...} or "pip": {...} Seems like these both should work Update with screenshots: Users table…
corysimmons
  • 7,296
  • 4
  • 57
  • 65
0
votes
0 answers

Hasura: Complete transaction after successful file upload

I have a file uploader using Hasura and AWS S3. Is there a way for me to upload a file and insert into the database, and if one of the operations fail, rollback the change? Here is some pseudocode to demonstrate what I mean: query('... hasura query…
Get Off My Lawn
  • 34,175
  • 38
  • 176
  • 338
0
votes
0 answers

Hasura Real Time Function to update table

am trying to figure out how to update this table, so when an order is placed, spots decrease by that order, and also free is updated. Then once a person checks out free will increment. { id: 1, title: "Hotel 1", price: 5, rating: 4.2, spots:…
KaliBoy
  • 121
  • 1
  • 4
0
votes
1 answer

Multiple components with multiple useQuery Apollo client

I have a data visualization page that has a lot of graphs, maps, etc. to visualize data. I approached the problem by keeping each visualization its own self contained component. So now I have ~20 components all executing useQuery which slows the…
mbn
  • 3
  • 1
0
votes
1 answer

Hasura API with Python POST gives 404 Error

I'm trying to use the Hasura API to get the contents of my database. The appropriate endpoint is v1alpha1/pg_dump. I've tried doing the following in Python: import requests api_url = 'http://localhost:9695/v1alpha1/pg_dump' header = {'Content-Type':…
Elliptica
  • 3,928
  • 3
  • 37
  • 68
0
votes
1 answer

Is there a way to compare each item to a aggreated value?

I'm new to graphQL and Hasura. I'm trying(in Hasura) to let me users provide custom aggregation (ideally in the form of a normal graphQL query) and have then each item the results compared against the aggreation. Here's a example. Assume I have this…
Lostsoul
  • 25,013
  • 48
  • 144
  • 239