GraphQL on Hasura¶
Starting from version v0.15.31
, the data microservice supports querying over GraphQL
in addition to the JSON based query language. The API Explorer
section of the API console
has GraphiQL integrated to let you explore the GraphQL APIs of Hasura.
Quick overview¶
- Getting GraphQL APIs over a table:
- Create a table.
- That’s it. The GraphQL APIs are ready. You can try them out at the API Explorer.
- Adding another table to GraphQL schema:
- Create another table just like you did in 1.
- Another table has been added to the schema :-)
- Linking the two tables and getting GraphQL APIs over them:
- Create a relationship between the two tables.
- GraphQL APIs over the relationship are ready. You can start fetching over them.
- Access control for your tables:
- Set permissions over your tables.
- Once you set permissions, the GraphQL queries and mutations will respect these permissions.
To know about the GraphQL API in detail, check out the reference.
Note
If you already have a Postgres database and wish to have GraphQL APIs over it, we have a quick guide for migrating your database here.
Was this page helpful?