mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-16 09:51:59 +03:00
421a182f64
* export metadata without nulls, empty arrays * property tests for 'ReplaceMetadata' using QuickCheck -> Derive Arbitrary class for 'ReplaceMetadata' dependant types * reduce property test cases number to 30 QuickCheck generates the `ReplaceMetadata` value really large for higher number test cases. Encoded JSON for such values is large and consumes more memory. Thus, CI is giving up while running property tests. * circle-ci: Add property tests as saperate job * add no command mode to tests * add yaml.v2 to go mod * remove indirect comment for yaml.v2 dependency
197 lines
3.6 KiB
YAML
197 lines
3.6 KiB
YAML
type: bulk
|
|
args:
|
|
|
|
- type: run_sql
|
|
args:
|
|
sql: |
|
|
CREATE TABLE test1 (id serial primary key);
|
|
CREATE TABLE test2 (id serial primary key);
|
|
|
|
CREATE FUNCTION get_test1(int)
|
|
RETURNS SETOF test1 as $$
|
|
SELECT * FROM test1 WHERE id = $1
|
|
$$ LANGUAGE SQL STABLE;
|
|
|
|
CREATE FUNCTION get_test2(int)
|
|
RETURNS SETOF test2 as $$
|
|
SELECT * FROM test2 WHERE id = $1
|
|
$$ LANGUAGE SQL STABLE;
|
|
|
|
- type: track_table
|
|
args: test1
|
|
- type: track_table
|
|
version: 2
|
|
args:
|
|
table: test2
|
|
configuration:
|
|
custom_root_fields:
|
|
select: test2_select
|
|
insert: test2_insert
|
|
custom_column_names:
|
|
id: test2_id
|
|
|
|
- type: create_object_relationship
|
|
args:
|
|
table: test1
|
|
name: test2_obj1
|
|
using:
|
|
manual_configuration:
|
|
remote_table: test2
|
|
column_mapping:
|
|
id: id
|
|
- type: create_object_relationship
|
|
args:
|
|
table: test1
|
|
name: test2_obj2
|
|
using:
|
|
manual_configuration:
|
|
remote_table: test2
|
|
column_mapping:
|
|
id: id
|
|
|
|
- type: create_array_relationship
|
|
args:
|
|
table: test2
|
|
name: test1_arr1
|
|
using:
|
|
manual_configuration:
|
|
remote_table: test2
|
|
column_mapping:
|
|
id: id
|
|
- type: create_array_relationship
|
|
args:
|
|
table: test2
|
|
name: test1_arr2
|
|
using:
|
|
manual_configuration:
|
|
remote_table: test2
|
|
column_mapping:
|
|
id: id
|
|
|
|
- type: create_select_permission
|
|
args:
|
|
table: test1
|
|
role: role1
|
|
permission:
|
|
columns: '*'
|
|
filter: {}
|
|
- type: create_select_permission
|
|
args:
|
|
table: test1
|
|
role: role2
|
|
permission:
|
|
columns: '*'
|
|
filter: {}
|
|
|
|
- type: create_insert_permission
|
|
args:
|
|
table: test1
|
|
role: role1
|
|
permission:
|
|
check: {}
|
|
- type: create_insert_permission
|
|
args:
|
|
table: test1
|
|
role: role2
|
|
permission:
|
|
check: {}
|
|
|
|
- type: create_update_permission
|
|
args:
|
|
table: test1
|
|
role: role1
|
|
permission:
|
|
columns: '*'
|
|
filter: {}
|
|
- type: create_update_permission
|
|
args:
|
|
table: test1
|
|
role: role2
|
|
permission:
|
|
columns: '*'
|
|
filter: {}
|
|
|
|
- type: create_delete_permission
|
|
args:
|
|
table: test1
|
|
role: role1
|
|
permission:
|
|
filter: {}
|
|
- type: create_delete_permission
|
|
args:
|
|
table: test1
|
|
role: role2
|
|
permission:
|
|
filter: {}
|
|
|
|
- type: create_event_trigger
|
|
args:
|
|
table: test1
|
|
name: event_trigger_1
|
|
insert:
|
|
columns: '*'
|
|
update:
|
|
columns: '*'
|
|
webhook: http://httpbin.org/post
|
|
- type: create_event_trigger
|
|
args:
|
|
table: test1
|
|
name: event_trigger_2
|
|
insert:
|
|
columns: '*'
|
|
update:
|
|
columns: '*'
|
|
webhook: http://httpbin.org/post
|
|
|
|
- type: track_function
|
|
args: get_test1
|
|
- type: track_function
|
|
args: get_test2
|
|
|
|
- type: create_query_collection
|
|
args:
|
|
name: collection_1
|
|
definition:
|
|
queries:
|
|
- name: query_1
|
|
query: |
|
|
query {
|
|
test1{
|
|
id
|
|
}
|
|
}
|
|
- name: query_2
|
|
query: |
|
|
query {
|
|
test2{
|
|
id
|
|
}
|
|
}
|
|
|
|
- type: create_query_collection
|
|
args:
|
|
name: collection_2
|
|
definition:
|
|
queries:
|
|
- name: query_1
|
|
query: |
|
|
query {
|
|
get_test1(args: {id: 1}){
|
|
id
|
|
}
|
|
}
|
|
- name: query_2
|
|
query: |
|
|
query {
|
|
get_test2(args: {id: 1}){
|
|
id
|
|
}
|
|
}
|
|
|
|
- type: add_collection_to_allowlist
|
|
args:
|
|
collection: collection_1
|
|
- type: add_collection_to_allowlist
|
|
args:
|
|
collection: collection_2
|