The Hasura GraphQL Engine is an extremely lightweight, high performance product that gives you instant realtime GraphQL APIs on a Postgres database. This can be used to quickly build new applications on Postgres or fast-track the move to GraphQL for existing applications on Postgres.
Hasura Crash Course by Laith Academy
mutation{
insert_posts(objects:{
content:"This is my mutation posts",
title: "My mutation",
user_id: 1
}){
returning{
title
user {
username
}
}
}
}
mutation{
update_users_by_pk(pk_columns:{id:1}, _set: {
age: 99
}){
id
username
}
}
mutation{
delete_users_by_pk(id: 5){
id
username
}
}
query{
users{
id
username
}
}
query{
users(where: {gender:{_eq: false}}) {
id
username
}
}
query{
users_by_pk(id: 1){
username
posts{
title
content
id
},
comments{
content
id
}
}
}
{
posts_by_pk(id: 1){
title
content
comments(order_by: {id: desc}){
id
content
user{
username
}
}
}
}
HackMD Note URL: https://hackmd.io/Wux1wxsPRe2nAWa78tf93g