graphql-engine/server/tests-py/queries/v1/set_table_configuration/alter_column.yaml
Daniel Chambers a8424c48a1 Customize column GraphQL schema descriptions
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3888
GitOrigin-RevId: 027c319a66671a44fc6e5506bdfc9d2c10a8569f
2022-03-09 06:35:46 +00:00

50 lines
978 B
YAML

- description: Set custom column names
url: /v1/query
status: 200
response:
message: success
query:
type: set_table_customization
args:
table: author
configuration:
custom_root_fields:
select: Authors
column_config:
id:
custom_name: AuthorId
name:
custom_name: AuthorName
- description: "Rename column 'id' and drop column 'name'"
url: /v1/query
status: 200
response:
result_type: CommandOk
result: null
query:
type: run_sql
args:
sql: |
ALTER TABLE author DROP COLUMN name;
ALTER TABLE author RENAME COLUMN id to author_id;
- description: Test if custom column names are updated
url: /v1/graphql
status: 200
response:
data:
Authors:
- AuthorId: 1
age: 23
- AuthorId: 2
age: null
query:
query: |
query {
Authors{
AuthorId
age
}
}