For most Nhost projects you will only use the default schema (public
). If you need other schemas Haura supports that too.
To add a schema, click the '+' symbol in the left menu in the Hasura console.
Here, we have created a chat schema, with no tables. You can change schemas via the schema dropdown on the top left.
When you create a table, you can create foreign key constraints between schemas:
You can access tables from a different schema from the GraphQL endpoint, note that the schema name is prepended (chat_
) to the table name:
Custom schemas prepend the schema name to the GraphQL field. All tables in the public schema are accessible via Hasura without the schema name.