2020-02-13 20:38:23 +03:00
|
|
|
type: bulk
|
|
|
|
args:
|
2021-01-06 19:06:24 +03:00
|
|
|
|
2020-02-13 20:38:23 +03:00
|
|
|
- type: run_sql
|
|
|
|
args:
|
|
|
|
sql: |
|
|
|
|
CREATE TABLE "user"(
|
|
|
|
id SERIAL PRIMARY KEY,
|
|
|
|
name TEXT NOT NULL,
|
|
|
|
email TEXT NOT NULL,
|
|
|
|
is_admin BOOLEAN NOT NULL DEFAULT false
|
|
|
|
);
|
|
|
|
|
|
|
|
- type: track_table
|
|
|
|
args:
|
|
|
|
name: user
|
|
|
|
schema: public
|
|
|
|
|
|
|
|
- type: set_custom_types
|
|
|
|
args:
|
|
|
|
objects:
|
|
|
|
- name: UserId
|
|
|
|
fields:
|
|
|
|
- name: id
|
|
|
|
type: Int!
|
|
|
|
relationships:
|
|
|
|
- name: user
|
|
|
|
type: object
|
|
|
|
remote_table: user
|
|
|
|
field_mapping:
|
|
|
|
id: id
|
2021-12-16 02:51:52 +03:00
|
|
|
- name: UserIdObj
|
|
|
|
fields:
|
|
|
|
- name: id
|
|
|
|
type: Int
|
|
|
|
- name: UserIdNested
|
|
|
|
fields:
|
|
|
|
- name: userObj
|
|
|
|
type: UserIdObj
|
2020-02-13 20:38:23 +03:00
|
|
|
|
|
|
|
- type: create_action
|
|
|
|
args:
|
|
|
|
name: create_user
|
|
|
|
definition:
|
|
|
|
kind: asynchronous
|
|
|
|
arguments:
|
|
|
|
- name: email
|
|
|
|
type: String!
|
|
|
|
- name: name
|
|
|
|
type: String!
|
|
|
|
output_type: UserId
|
|
|
|
handler: http://127.0.0.1:5593/create-user
|
|
|
|
|
|
|
|
- type: create_action_permission
|
|
|
|
args:
|
|
|
|
action: create_user
|
|
|
|
role: user
|
|
|
|
definition:
|
|
|
|
select:
|
|
|
|
filter: {}
|
2021-09-16 14:03:01 +03:00
|
|
|
|
|
|
|
- type: create_action
|
|
|
|
args:
|
|
|
|
name: create_user_transformed
|
|
|
|
definition:
|
|
|
|
kind: asynchronous
|
|
|
|
arguments:
|
|
|
|
- name: email
|
|
|
|
type: String!
|
|
|
|
- name: name
|
|
|
|
type: String!
|
|
|
|
output_type: UserId
|
|
|
|
handler: http://127.0.0.1:5593/create-user
|
2021-10-29 07:12:27 +03:00
|
|
|
request_transform:
|
2022-02-17 07:36:24 +03:00
|
|
|
version: 2
|
2021-10-29 07:12:27 +03:00
|
|
|
template_engine: Kriti
|
2022-02-17 07:36:24 +03:00
|
|
|
body:
|
|
|
|
action: transform
|
|
|
|
template: |
|
|
|
|
{
|
|
|
|
"input": {
|
|
|
|
"email": "foo@bar.com",
|
|
|
|
"name": "notClarke"
|
|
|
|
}
|
2021-10-29 07:12:27 +03:00
|
|
|
}
|
2021-12-16 02:51:52 +03:00
|
|
|
|
|
|
|
- type: create_action
|
|
|
|
args:
|
|
|
|
name: create_user_nested
|
|
|
|
definition:
|
|
|
|
kind: asynchronous
|
|
|
|
arguments:
|
|
|
|
- name: email
|
|
|
|
type: String!
|
|
|
|
- name: name
|
|
|
|
type: String!
|
|
|
|
output_type: UserIdNested
|
|
|
|
handler: http://127.0.0.1:5593/create-user-nested
|