mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-19 21:41:44 +03:00
63291f6de8
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2603 GitOrigin-RevId: 32b3133f0bb1a9bf50e4db492bab1eabf5a9430c
43 lines
1.5 KiB
YAML
43 lines
1.5 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: create_query_collection
|
|
args:
|
|
name: test_collection
|
|
definition:
|
|
queries:
|
|
- name: simple_query
|
|
query: "query { test_table { first_name 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 } }"
|