graphql-engine/server/tests-py/queries/v1/set_table_custom_fields/setup.yaml
Rakesh Emmadi c4c5dd87ac allow identical fields in custom column names configuration (fix #3137) & improve root fields validation (#3154)
* allow identical column fields in 'custom_column_names'
* improve validation of custom column names
* improve 'checkForFieldConflicts' & validate custom column names with non column fields
* split `validateTableConfig` into two isolated validation logic
* improve validation of root fields
* improve validating custom root fields and duplicate root fields
* move 'validateCustomRootFields' to 'buildSchemaCache'
2019-11-20 06:40:56 -06:00

52 lines
1.0 KiB
YAML

type: bulk
args:
- type: run_sql
args:
sql: |
CREATE TABLE author (
id SERIAL PRIMARY KEY,
name TEXT NOT NULL,
age INTEGER
);
INSERT INTO author (name, age) VALUES
('Clarke', 23),
('Bellamy', NULL);
CREATE TABLE article (
id SERIAL PRIMARY KEY,
title TEXT NOT NULL,
content TEXT,
author_id INTEGER NOT NULL REFERENCES author(id)
);
INSERT INTO article (title, content, author_id) VALUES
('Article 1 title', 'Article 1 content', 1),
('Article 2 title', 'Article 2 content', 2);
- type: track_table
version: 2
args:
table: author
configuration:
custom_root_fields:
select: Authors
custom_column_names:
id: AuthorId
- type: track_table
version: 2
args:
table: article
configuration: {}
- type: create_array_relationship
args:
name: articles
table: author
using:
foreign_key_constraint_on:
table: article
column: author_id