graphql-engine/server/tests-py/queries/endpoints/setup.yaml
Lyndon Maydwell 0767333597 server: support restified versions of graphql queries (#303)
Restified GraphQL Endpoints feature.

GitOrigin-RevId: 3d6e589426ec21a60a915b47f579f0ac4934af45
2021-01-29 01:03:35 +00:00

109 lines
2.3 KiB
YAML

type: bulk
args:
- 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 } }"
- 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: 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
- type: run_sql
args:
sql: |
create table test_table(
first_name text,
last_name text
);
- 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');