graphql-engine/server/tests-py/queries/graphql_query/allowlist/setup.yaml
paritosh-08 7f4565fad2 server: validate top level fragments in GQL query
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4299
GitOrigin-RevId: 70925779d41c5a9fe66577b941c674577a4a9a13
2022-04-20 07:33:21 +00:00

74 lines
1.3 KiB
YAML

type: bulk
args:
- type: run_sql
args:
sql: |
DROP TABLE IF EXISTS "user";
CREATE TABLE "user" (
id SERIAL PRIMARY KEY,
name TEXT NOT NULL,
account_id INTEGER NOT NULL,
company TEXT
);
INSERT INTO "user"
(name, account_id, company)
VALUES
('clarke', 23, 'Symons'),
('reckler', 2, NULL);
- type: track_table
args:
schema: public
name: user
- type: create_select_permission
args:
table: user
role: user
permission:
filter: {}
columns: '*'
- type: create_query_collection
args:
name: collection_1
comment: First query collection
definition:
queries:
- name: query_1
query: |
query {
user{
id
name
company
}
}
- name: query_2
query: |
query ($id: Int!){
user_by_pk(id: $id){
id
__typename
name
company
}
}
- name: query_3
query: |
fragment userDetails on user {
id
name
company
}
query {
user{
...userDetails
}
}
- type: add_collection_to_allowlist
args:
collection: collection_1