Skip to main content
Version: v2.x

Postgres: Customize Auto-Generated Field Names

Introduction

Hasura auto-generates GraphQL field names based on your database table and column names. If you'd like to change the defaults, it is possible to override and rename the auto-generated table and column field names exposed over the GraphQL API.

Supported from

This feature is supported in versions v1.0.0-beta.8 and later.

Expose columns with a different name in the GraphQL API

Head to the Data -> [table-name] -> Modify. On the relevant field, click Edit and change the GraphQL field name to a name of your choice.

Customize GraphQL field name

Expose table root fields with a different name in the GraphQL API

Head to the Data -> [table-name] -> Modify. Click the Edit button in the Custom GraphQL Root Fields section and define names over which you'd like to expose the table root fields.

Customize GraphQL root field