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

Int cannot represent non-integer value: "4"

The error obviously makes sense. We are passing strings for Int value, but this used to work just fine. This has quite big implication on our code. Example of error: I also have 2 environment running with same Hasura version. On one of these this…
0
votes
1 answer

Return boolean from Hasura PostgreSQL function

I have a subscription table and I want to add a field called is_subscription_active as a computed field on that table. I wrote a function to return a boolean from the PostgreSQL function after looking at some examples, but I can't seem to figure out…
Riptide
  • 472
  • 3
  • 14
0
votes
1 answer

Creating an Action

I am creating my first Hasura Action and got stuck. While I do think there team have done great job in documentation, I am having tough time in comprehending few things. First, what is this !? in say this login (username: String!, password:…
Rahul Patel
  • 63
  • 1
  • 11
0
votes
1 answer

Hasura User Role Inherited Permissions from Anonymous

I'm trying to grant access so that users can access all user information about themselves + non-sensitive information about others in the user table. I thought user would inherit permissions from anonymous user which would give them access to the…
Ray Kanani
  • 261
  • 1
  • 3
  • 8
0
votes
1 answer

How do graphQL engines like Hasura know to trigger jobs once even when they're scaled to multiple instances?

I deployed a few instances of the same Hasura server unto AWS ECS, I added a CRON job that I wanted to test out, and apparently the job is run only once (which is the ideal situation). I was worried I'd have to figure out how to make sure jobs are…
Abe Shalash
  • 101
  • 1
  • 7
0
votes
1 answer

Remove user while also removing unused tags in many-to-many relationship in GraphQL?

I'm using Hasura for this. Say for example I have a users, tags and users_tags table in a many-to-many relationship. User's can define multiple tags (like a persons hobbies) and each tag can belong to multiple people. Table users { id int [pk…
Kernel James
  • 3,752
  • 25
  • 32
0
votes
2 answers

How to setup Hasura CLI?

I installed hasura CLI and I want to send data on my hasura cloud project. I tried different ways to launch hasura console but I don't find the good way to launch it. Every time I have the same error and I don't know how to solve it. You can see my…
0
votes
2 answers

Null value in bulk insert Hasura GraphQL

I am trying to do a multiple insert using a REST API exposed by Hasura (written in GraphQL). This is my mutation: mutation insertMultipleMeasurements2($payload: [measurements_insert_input!]!) { insert_measurements(objects: $payload) { …
0
votes
1 answer

Passing variables from mutation to query

I have a GraphQL mutation that creates an item and returns the data that's created. I need to pass some of the created fields into a query. Is this possible? This is almost working but I can't figure out how to get the data between the mutation and…
user1513388
  • 7,165
  • 14
  • 69
  • 111
0
votes
1 answer

Metadata Does Not seem to update correctly

Our company uses Hasura Cloud with a React js front end with gQlApollo. I recently added a new column "myString" to type "myType" in our database and was able to successfully update our Hasura Cloud instance by resetting the Metadata within…
0
votes
1 answer

Hasura permissions missing "_in" operator

According to this post, Hasura has the "_in" operation in permissions. I'm currently running Hasura 2.1.1, but none of the new operators described in that post are present: Looking around on the internet I found no mention of this, but maybe this…
Zeno Trevisan
  • 517
  • 1
  • 8
  • 23
0
votes
1 answer

Apollo GraphQL schema + codegen converting Hasura/PostgreSQL scalar array to scalar

I'm using Hasura to provide a GraphQL interface to a PostgreSQL table. If I have a table with an integer[] column, the command apollo schema:download is generating a schema.json with: { "name": "distances", "description":…
villasv
  • 6,304
  • 2
  • 44
  • 78
0
votes
0 answers

How can I specify custom GraphQL types for a Postgres view in Hasura?

I have a view that I'm tracking in Hasura. I essentially query one table and left-join additional data from other tables onto it: CREATE OR REPLACE VIEW "public"."user_summary" AS SELECT u.id AS user_id, u.display_name AS user_display_name, …
Salem
  • 1,122
  • 4
  • 19
  • 30
0
votes
1 answer

Syntax error near CASE on postgres function

CREATE OR REPLACE FUNCTION public.defaultmapviewport(hasura_session json) RETURNS viewport_info STABLE AS $function$ case hasura_session ->> 'x-hasura-default-country-code' when 'FR' then select lat, lng from places where slug_en =…
PlayMa256
  • 6,603
  • 2
  • 34
  • 54
0
votes
1 answer

Is it possible to export REST endpoints APIs in Hasura?

I am trying to move from a development Stack (that means a Docker stack) to an existing (but empty) production stack. Both of them are up with a docker-compose. I am using two different Portainer environments if it is useful to know. I'd like to…