mirror of
https://github.com/kou029w/hasura-rest-hands-on.git
synced 2025-01-18 16:08:14 +00:00
9 lines
761 B
YAML
9 lines
761 B
YAML
- name: allowed-queries
|
|
definition:
|
|
queries:
|
|
- name: get page
|
|
query: "query getPage($id: Int!) {\n page: pages_by_pk(id: $id) {\n id\n content\n }\n}"
|
|
- name: put page
|
|
query: "mutation putPage($id: Int, $content: jsonb!) {\n page: insert_pages_one(object: {id: $id, content: $content}, on_conflict: {constraint: pages_pkey, update_columns: content}) {\n id\n content\n }\n}"
|
|
- name: delete all
|
|
query: "mutation deleteAll($scheduled_time: String = \"\", $payload: jsonb = {}, $name: String = \"\", $id: String = \"\") {\n delete_pages(where: {id: {_is_null: false}, _or: {content: {_neq: {scheduled_time: $scheduled_time, payload: $payload, name: $name, id: $id}}}}) {\n affected_rows\n }\n}"
|