graphql-engine/server/tests-py/queries/naming_conventions/enum_value_convention.yaml
paritosh-08 42da1dbc2e server/docs: follow up on the naming convention
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4563
GitOrigin-RevId: 0ae1f226a63dae34e6cb0d001b4915c05b0974cf
2022-05-27 05:56:52 +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_convention: 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