mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-18 21:12:09 +03:00
a8424c48a1
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3888 GitOrigin-RevId: 027c319a66671a44fc6e5506bdfc9d2c10a8569f
50 lines
978 B
YAML
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
|
|
}
|
|
}
|