Tag: hasura
-
hasura-v2.xx gives graphql-engine-1 exited with code 1 on `hasura metadata track …`
0 I’m trying to get started with Hasura. So here is my docker-compose.yml file: version: "3.6" services: postgres: image: postgres:15 restart: always volumes: – db_data:/var/lib/postgresql/data environment: POSTGRES_PASSWORD: postgrespassword graphql-engine: build: context: . dockerfile: DockerfileHasura # command: /bin/sh -c ‘hasura metadata track –all-tables –all-relationships –schema public –endpoint https://graphql-engine:8080 && exec graphql-engine serve’ command: /bin/sh -c ‘exec…
-
Hasura graphql optional generated variable
0 how can I attach a variable to a mutation conditionally? I want to create an upsert mutation where the id is generated by the database. So, if the $id variable was set, make an update, otherwise, a creation. I have tried something like this: mutation upsert ( $id: uuid $name: String ) { insert_data_one(…
-
Hasura coversion of date time from date string
0 I have this select query as Native query in Hasura SELECT tblPhOrderSummary.Id as OrderId, tblPhOrderSummary.CreatedOn as OrderDate, tblItems.ItemCode as ItemCode, tblPhOrderProducts.ItemDescription, tblItems.ModelCode AS ModelCode, tblItems.Barcode AS Barcode, tblPhOrderProducts.LOT AS LOT, ” AS Batch, tblPhOrderProducts.Expiry AS Expiry, tblItems.SalesPrice AS UnitSalesPrice, tblPhOrderProducts.Instock AS InStock, tblPhOrderProducts.CurrentStock AS CurrentStock, tblPhOrderProducts.OrderQuantity AS OrderQuantity FROM tblPhOrderProducts INNER JOIN tblItems ON…
-
How to implement error handling globally for URQL GraphQL mutation?
0 My stack is: react v17.0.2 graphql v16.8.0 graphql-ws v5.14.0 urql v4.0.5 I use Hasura Actions to connect to REST API and I need to implement global error handling for all mutations. For example I have useAuthentication hook that returns a signOut promise: import { useMutation } from ‘urql’; export const useAuthentication = () =>…
-
Customize /graphql endpoint to serve different schemas
0 In Hasura, is there a way to customise the /graphql endpoint so that for customer 1, it serves a schema at /graphql/customer1 and serves another at /graphql/customer2 for customer 2? Currently, all my schemas are displayed in /graphql endpoint and it creates clutter and also makes the data visible to all when used with…
-
Problem to export Hasura metadata – FATA[0001] failed to export metadata
0 Im trying to export the hasura metadata but i’m receiving this error after running the command hasura metadata export : FATA[0001] failed to export metadata: cannot export actions from metadata: error parsing metadata object: actions file: actions.yaml error: error in converting metadata to sdl: exit status 4: Note: If I use sudo hasura metadata…
-
Is it possible to query multiple aggregates with different where conditions for each (hasura)?
0 Say I have two tables, clubs and posts. Each club can have many posts and my app stores a timestamp for when the user last viewed a post for each club (‘last_viewed’). What I want to do, is query for the number of all new posts (since that club was looked at) and display…
-
How to map to timestamp when return data from database using nestjs and graphql
0 I use nestjs and graphql save data into postgres. When i save data it save success on my database. Here dto input @InputType() export class CreateShop { //some field @Field(() => String, { name: ‘opening_time’ }) openingTime?: Timestamp; @Field(() => String, { name: ‘closing_time’ }) closingTime?: Timestamp; } My data save success on database…
-
MySQL Database connection error for hasura cloud
0 I am using hasura cloud environment. For MySQL database, I am using MySQL workbench and created a database. I want to use this database in hasura environment. MySQL server is up and running on the port 3306. My JDBC Connection string is: jdbc:mysql://localhost:3306/employees?user=admin&password=password@123 After connecting, I got this error [ { "definition": "employees", "message":…