mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-22 15:01:39 +03:00
0775c00b0d
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3658 GitOrigin-RevId: 3c644da15c92cac16356985d0fe0c6adb7001862
139 lines
3.2 KiB
YAML
139 lines
3.2 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: simple_query_cached
|
|
query: "query @cached(ttl: 5) { 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_uuid_args
|
|
query: "query ($ids: [uuid!]!) { test_table(where: {id: { _in: $ids }}) { first_name last_name } }"
|
|
- name: simple_subscription
|
|
query: "subscription { test_table { first_name last_name } }"
|
|
|
|
- type: create_rest_endpoint
|
|
args:
|
|
url: simple
|
|
name: simple
|
|
methods:
|
|
- GET
|
|
definition:
|
|
query:
|
|
collection_name: test_collection
|
|
query_name: simple_query
|
|
|
|
- type: create_rest_endpoint
|
|
args:
|
|
url: simple_cached
|
|
name: simple_cached
|
|
methods:
|
|
- GET
|
|
definition:
|
|
query:
|
|
collection_name: test_collection
|
|
query_name: simple_query_cached
|
|
|
|
- type: create_rest_endpoint
|
|
args:
|
|
url: with_arg
|
|
name: with_arg
|
|
methods:
|
|
- GET
|
|
- POST
|
|
definition:
|
|
query:
|
|
collection_name: test_collection
|
|
query_name: query_with_arg
|
|
|
|
- type: create_rest_endpoint
|
|
args:
|
|
url: with_args
|
|
name: with_args
|
|
methods:
|
|
- GET
|
|
definition:
|
|
query:
|
|
collection_name: test_collection
|
|
query_name: query_with_args
|
|
|
|
- type: create_rest_endpoint
|
|
args:
|
|
url: with_template/:first_name
|
|
name: with_template
|
|
methods:
|
|
- GET
|
|
definition:
|
|
query:
|
|
collection_name: test_collection
|
|
query_name: query_with_arg
|
|
|
|
- type: create_rest_endpoint
|
|
args:
|
|
url: with_uuid/:id
|
|
name: with_uuid
|
|
methods:
|
|
- GET
|
|
definition:
|
|
query:
|
|
collection_name: test_collection
|
|
query_name: query_with_uuid_arg
|
|
|
|
- type: create_rest_endpoint
|
|
args:
|
|
url: with_uuids
|
|
name: with_uuids
|
|
methods:
|
|
- POST
|
|
definition:
|
|
query:
|
|
collection_name: test_collection
|
|
query_name: query_with_uuid_args
|
|
|
|
|
|
- type: create_rest_endpoint
|
|
args:
|
|
url: to_be_dropped
|
|
name: to_be_dropped
|
|
methods:
|
|
- GET
|
|
definition:
|
|
query:
|
|
collection_name: test_collection
|
|
query_name: simple_query
|
|
|
|
- type: drop_rest_endpoint
|
|
args:
|
|
name: to_be_dropped
|