mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-23 07:22:53 +03:00
5bc0355bdd
GitOrigin-RevId: abd7303aaf8e7a8739fd10574249aec450082ef8
69 lines
1.2 KiB
YAML
69 lines
1.2 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:
|
|
input_objects:
|
|
- name: UserInput
|
|
fields:
|
|
- name: name
|
|
type: String!
|
|
- name: email
|
|
type: String!
|
|
|
|
- name: InObject
|
|
fields:
|
|
- name: id
|
|
type: ID
|
|
- name: name
|
|
type: String
|
|
- name: age
|
|
type: Int
|
|
|
|
objects:
|
|
- name: UserId
|
|
fields:
|
|
- name: id
|
|
type: Int!
|
|
relationships:
|
|
- name: user
|
|
type: object
|
|
remote_table: user
|
|
field_mapping:
|
|
id: id
|
|
|
|
- type: create_action
|
|
args:
|
|
name: create_user
|
|
definition:
|
|
kind: synchronous
|
|
arguments:
|
|
- name: email
|
|
type: String!
|
|
- name: name
|
|
type: String!
|
|
output_type: UserId
|
|
handler: http://127.0.0.1:5593/create-user
|
|
|
|
- type: add_remote_schema
|
|
args:
|
|
name: actions-remote-join-schema
|
|
definition:
|
|
url: http://localhost:4001
|
|
forward_client_headers: false
|