graphql-engine/server/tests-py/queries/openapi/setup.yaml
Daniel Chambers bd6f7cd756 Fixed GQL aliases not being respected in the OpenAPI schema
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3484
GitOrigin-RevId: 0f49dd7f64e80dfe6940d673afa76f12f6599126
2022-01-27 05:55:55 +00:00

76 lines
2.8 KiB
YAML

type: bulk
args:
- type: run_sql
args:
sql: |
create table test_table(
first_name text,
last_name text,
id UUID NOT NULL DEFAULT gen_random_uuid()
);
- type: track_table
args:
schema: public
name: test_table
- type: run_sql
args:
sql: |
insert into test_table (first_name, last_name)
values
('Foo', 'Bar'),
('Baz', 'Qux'),
('X%20Y', 'Test');
- type: run_sql
args:
sql: |
create table test_table_recurse(
random_data text,
id UUID NOT NULL DEFAULT gen_random_uuid()
);
- type: track_table
args:
schema: public
name: test_table_recurse
- type: create_object_relationship
args:
table: test_table_recurse
name: recurse_rel
using:
manual_configuration:
remote_table: test_table_recurse
column_mapping:
id : id
- type: create_query_collection
args:
name: test_collection
definition:
queries:
- name: simple_query
query: "query { test_table { first_name last_name } }"
- name: simple_query_with_aliases
query: "query { test: test_table { firstName: first_name lastName: last_name surname: last_name } }"
- name: query_with_arg
query: "query ($first_name:String!) { test_table(where: {first_name: { _eq: $first_name } }) { first_name last_name } }"
- name: query_with_args
query: "query ($first_name: String!, $last_name:String!) { test_table(where: {first_name: { _eq: $first_name } last_name: { _eq: $last_name }}) { first_name last_name } }"
- name: query_with_uuid_arg
query: "query ($id: uuid!) { test_table(where: {id: { _neq: $id }}) { first_name last_name } }"
- name: query_with_default_arg
query: "query ($first_name:String=\"Foo\") { test_table(where: {first_name: { _eq: $first_name } }) { first_name last_name } }"
- name: mutation_with_args
query: "mutation ($first_name: String!, $last_name: String!) { insert_test_table( objects: {first_name: $first_name, last_name: $last_name }) { returning { id } affected_rows } }"
- name: mutation_complex_arg
query: "mutation ($objects: [test_table_insert_input!]!) { insert_test_table( objects: $objects) { returning { id } } }"
- name: mutation_complex_args
query: "mutation QQ($new_object: test_table_set_input!, $first_name: String!) { update_test_table(where: {first_name: {_eq: $first_name}}, _set: $new_object) { affected_rows } }"
- name: mutation_recursive_arg
query: "mutation MyMutation($object: test_table_recurse_insert_input!) { insert_test_table_recurse_one(object: $object) { id } }"
- name: query_with_duplicate_field_name
query: "query { test_table { first_name } test_table { last_name } }"