mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-18 21:12:09 +03:00
0ffb0478b9
* 1) Tests for creating permissions 2) Test for constraint_on with GraphQL insert on_conflict * Run tests with access key and webhook * Tests for GraphQL query with quoted columns * Rewrite test-server.sh so that it can be run locally * JWT based tests * Tests with various postgres types * For tests on select queries, run setup only once per class * Tests for v1 count queries * Skip teardown for tests that does not modify data * Workaround for hpc 'parse error when reading .tix file' * Move GeoJson tests to the new structure * Basic tests for v1 queries * Tests for column, table or operator not found error cases on GraphQL queries * Skip test teardown for mutation tests which does not change database state, even when it returns 200.
95 lines
1.6 KiB
YAML
95 lines
1.6 KiB
YAML
type: bulk
|
|
args:
|
|
|
|
#Author table
|
|
- type: run_sql
|
|
args:
|
|
sql: |
|
|
create table author(
|
|
id serial primary key,
|
|
name text unique,
|
|
is_registered boolean
|
|
);
|
|
- type: track_table
|
|
args:
|
|
schema: public
|
|
name: author
|
|
|
|
#Article table
|
|
- type: run_sql
|
|
args:
|
|
sql: |
|
|
CREATE TABLE article (
|
|
id SERIAL PRIMARY KEY,
|
|
title TEXT,
|
|
content TEXT,
|
|
author_id INTEGER REFERENCES author(id),
|
|
is_published BOOLEAN,
|
|
published_on TIMESTAMP
|
|
)
|
|
- type: track_table
|
|
args:
|
|
schema: public
|
|
name: article
|
|
#Object relationship
|
|
- type: create_object_relationship
|
|
args:
|
|
table: article
|
|
name: author
|
|
using:
|
|
foreign_key_constraint_on: author_id
|
|
|
|
#Insert values
|
|
- type: run_sql
|
|
args:
|
|
sql: |
|
|
insert into author (name, is_registered)
|
|
values
|
|
('Author 1', false),
|
|
('Author 2', true),
|
|
('Author 3', true),
|
|
('Author 4', false)
|
|
|
|
- type: run_sql
|
|
args:
|
|
sql: |
|
|
insert into article (title, content, author_id, is_published)
|
|
values
|
|
(
|
|
'Article 1',
|
|
'Sample article content 1',
|
|
1,
|
|
false
|
|
),
|
|
(
|
|
'Article 2',
|
|
'Sample article content 2',
|
|
1,
|
|
true
|
|
),
|
|
(
|
|
'Article 3',
|
|
'Sample article content 3',
|
|
2,
|
|
false
|
|
),
|
|
(
|
|
'Article 4',
|
|
'Sample article content 4',
|
|
3,
|
|
false
|
|
),
|
|
(
|
|
'Article 5',
|
|
'Sample article content 5',
|
|
3,
|
|
false
|
|
),
|
|
(
|
|
'Article 6',
|
|
'Sample article content 6',
|
|
3,
|
|
true
|
|
)
|
|
|