graphql-engine/server/tests-py/queries/naming_conventions/enum_value_convention.yaml
paritosh-08 fd30fb343b server: naming conventions for auto generated fields
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3982
Co-authored-by: Brandon Simmons <210815+jberryman@users.noreply.github.com>
GitOrigin-RevId: f90b2e8f394e7bd69780f003d2d980475f104f42
2022-05-26 11:55:29 +00:00

130 lines
2.6 KiB
YAML

- description: PG add source
url: /v1/metadata
status: 200
response:
message: success
query:
type: pg_add_source
args:
name: pg1
configuration:
connection_info:
database_url:
from_env: HASURA_GRAPHQL_PG_SOURCE_URL_1
pool_settings:
max_connections: 50
idle_timeout: 180
retries:
customization:
naming_conventions: graphql-default
- description: create enum table
url: /v1/query
status: 200
response:
result_type: CommandOk
result:
query:
type: run_sql
args:
source: pg1
sql: |
CREATE TABLE days_of_the_week(
day_name text PRIMARY KEY
);
INSERT INTO days_of_the_week (day_name)
VALUES ('Monday'), ('Tuesday'), ('Wednesday'), ('Thursday'), ('Friday'), ('Saturday'), ('Sunday');
CREATE TABLE users(
id serial PRIMARY KEY,
favourite_day text NOT NULL REFERENCES days_of_the_week
);
INSERT INTO users (favourite_day)
VALUES ('Sunday');
- description: Track tables
url: /v1/query
status: 200
response:
- message: success
- message: success
query:
type: bulk
args:
- type: track_table
args:
table: days_of_the_week
source: pg1
is_enum: true
- type: track_table
args:
source: pg1
table: users
- description: Check the enum values (should be uppercased)
url: /v1/graphql
status: 200
response:
data:
__type:
enumValues:
- name: FRIDAY
- name: MONDAY
- name: SATURDAY
- name: SUNDAY
- name: THURSDAY
- name: TUESDAY
- name: WEDNESDAY
query:
query: |
{
__type(name: "DaysOfTheWeekEnum") {
enumValues {
name
}
}
}
- description: Untrack tables
url: /v1/metadata
status: 200
response:
- message: success
- message: success
query:
type: bulk
args:
- type: pg_untrack_table
args:
table: days_of_the_week
source: pg1
- type: pg_untrack_table
args:
source: pg1
table: users
- description: drop table
url: /v1/query
status: 200
response:
result_type: CommandOk
result:
query:
type: run_sql
args:
source: pg1
sql: |
drop table users;
drop table days_of_the_week;
- description: PG Drop Source 1
url: /v1/metadata
status: 200
response:
message: success
query:
type: pg_drop_source
args:
name: pg1