graphql-engine/server/tests-py/queries/graphql_query/enums/setup.yaml
Alexis King c0d7402e15
Fix two enum table reference bugs (fix #2820 and #3010) (#3074)
* Include enum types in schema whenever references are visible (fix #2820)
* Fix RQL parsing for nullable enum table references (fix #3010)
2019-10-10 21:22:16 -05:00

41 lines
929 B
YAML

type: bulk
args:
- type: run_sql
args:
sql: |
CREATE TABLE colors
( value text PRIMARY KEY
, comment text );
INSERT INTO colors (value, comment) VALUES
('red', '#FF0000'),
('green', '#00FF00'),
('blue', '#0000FF'),
('orange', '#FFFF00'),
('yellow', '#00FFFF'),
('purple', '#FF00FF');
CREATE TABLE users
( id serial PRIMARY KEY
, name text NOT NULL
, favorite_color text NOT NULL REFERENCES colors );
INSERT INTO users (name, favorite_color) VALUES
('Alyssa', 'red'),
('Ben', 'blue');
- type: track_table
args:
table: colors
is_enum: true
- type: track_table
args: users
# Anonymous users can query users, but not colors
- type: create_select_permission
args:
table: users
role: anonymous
permission:
columns: [id, name, favorite_color]
filter: {}