mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-18 04:51:35 +03:00
d1ba271c3d
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3475 GitOrigin-RevId: bc847b18d491fe4957a190f5d0fe2ae6e6719791
99 lines
1.9 KiB
YAML
99 lines
1.9 KiB
YAML
type: bulk
|
|
args:
|
|
|
|
- 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
|
|
- name: UserIdObj
|
|
fields:
|
|
- name: id
|
|
type: Int
|
|
- name: UserIdNested
|
|
fields:
|
|
- name: userObj
|
|
type: UserIdObj
|
|
|
|
- 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: {}
|
|
|
|
- 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
|
|
request_transform:
|
|
version: 2
|
|
template_engine: Kriti
|
|
body:
|
|
action: transform
|
|
template: |
|
|
{
|
|
"input": {
|
|
"email": "foo@bar.com",
|
|
"name": "notClarke"
|
|
}
|
|
}
|
|
|
|
- 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
|