graphql-engine/server/tests-py/queries/actions/sync/schema_setup.yaml
Rakesh Emmadi f80b69e931
few actions' fixes and improvements (fix #3977, #4061 & close #4021) (#4109)
* add 'ID' to default scalars for custom types, fix #4061

* preserve cookie headers from sync action webhook, close #4021

* validate action webhook response to conform to output type, fix #3977

* fix tests, don't run actions' tests on PG version < 10

* update CHANGELOG.md

* no-op refactor, use types from http-network more

Co-authored-by: Vamshi Surabhi <0x777@users.noreply.github.com>
2020-03-20 12:16:45 +05:30

90 lines
1.7 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
- name: OutObject
fields:
- name: id
type: ID! # For issue https://github.com/hasura/graphql-engine/issues/4061
- name: name
type: String
- 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: create_action
args:
name: create_users
definition:
kind: synchronous
arguments:
- name: users
type: '[UserInput!]!'
output_type: '[UserId]'
handler: http://127.0.0.1:5593/create-users
- type: create_action
args:
name: mirror
definition:
kind: synchronous
arguments:
- name: arg
type: 'InObject!'
output_type: 'OutObject'
handler: http://127.0.0.1:5593/mirror-action