graphql-engine/server/tests-py/queries/actions/sync/schema_setup.yaml

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

560 lines
12 KiB
YAML
Raw Normal View History

allow custom mutations through actions (#3042) * basic doc for actions * custom_types, sync and async actions * switch to graphql-parser-hs on github * update docs * metadata import/export * webhook calls are now supported * relationships in sync actions * initialise.sql is now in sync with the migration file * fix metadata tests * allow specifying arguments of actions * fix blacklist check on check_build_worthiness job * track custom_types and actions related tables * handlers are now triggered on async actions * default to pgjson unless a field is involved in relationships, for generating definition list * use 'true' for action filter for non admin role * fix create_action_permission sql query * drop permissions when dropping an action * add a hdb_role view (and relationships) to fetch all roles in the system * rename 'webhook' key in action definition to 'handler' * allow templating actions wehook URLs with env vars * add 'update_action' /v1/query type * allow forwarding client headers by setting `forward_client_headers` in action definition * add 'headers' configuration in action definition * handle webhook error response based on status codes * support array relationships for custom types * implement single row mutation, see https://github.com/hasura/graphql-engine/issues/3731 * single row mutation: rename 'pk_columns' -> 'columns' and no-op refactor * use top level primary key inputs for delete_by_pk & account select permissions for single row mutations * use only REST semantics to resolve the webhook response * use 'pk_columns' instead of 'columns' for update_by_pk input * add python basic tests for single row mutations * add action context (name) in webhook payload * Async action response is accessible for non admin roles only if the request session vars equals to action's * clean nulls, empty arrays for actions, custom types in export metadata * async action mutation returns only the UUID of the action * unit tests for URL template parser * Basic sync actions python tests * fix output in async query & add async tests * add admin secret header in async actions python test * document async action architecture in Resolve/Action.hs file * support actions returning array of objects * tests for list type response actions * update docs with actions and custom types metadata API reference * update actions python tests as per #f8e1330 Co-authored-by: Tirumarai Selvan <tirumarai.selvan@gmail.com> Co-authored-by: Aravind Shankar <face11301@gmail.com> Co-authored-by: Rakesh Emmadi <12475069+rakeshkky@users.noreply.github.com>
2020-02-13 20:38:23 +03:00
type: bulk
args:
allow custom mutations through actions (#3042) * basic doc for actions * custom_types, sync and async actions * switch to graphql-parser-hs on github * update docs * metadata import/export * webhook calls are now supported * relationships in sync actions * initialise.sql is now in sync with the migration file * fix metadata tests * allow specifying arguments of actions * fix blacklist check on check_build_worthiness job * track custom_types and actions related tables * handlers are now triggered on async actions * default to pgjson unless a field is involved in relationships, for generating definition list * use 'true' for action filter for non admin role * fix create_action_permission sql query * drop permissions when dropping an action * add a hdb_role view (and relationships) to fetch all roles in the system * rename 'webhook' key in action definition to 'handler' * allow templating actions wehook URLs with env vars * add 'update_action' /v1/query type * allow forwarding client headers by setting `forward_client_headers` in action definition * add 'headers' configuration in action definition * handle webhook error response based on status codes * support array relationships for custom types * implement single row mutation, see https://github.com/hasura/graphql-engine/issues/3731 * single row mutation: rename 'pk_columns' -> 'columns' and no-op refactor * use top level primary key inputs for delete_by_pk & account select permissions for single row mutations * use only REST semantics to resolve the webhook response * use 'pk_columns' instead of 'columns' for update_by_pk input * add python basic tests for single row mutations * add action context (name) in webhook payload * Async action response is accessible for non admin roles only if the request session vars equals to action's * clean nulls, empty arrays for actions, custom types in export metadata * async action mutation returns only the UUID of the action * unit tests for URL template parser * Basic sync actions python tests * fix output in async query & add async tests * add admin secret header in async actions python test * document async action architecture in Resolve/Action.hs file * support actions returning array of objects * tests for list type response actions * update docs with actions and custom types metadata API reference * update actions python tests as per #f8e1330 Co-authored-by: Tirumarai Selvan <tirumarai.selvan@gmail.com> Co-authored-by: Aravind Shankar <face11301@gmail.com> Co-authored-by: Rakesh Emmadi <12475069+rakeshkky@users.noreply.github.com>
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
);
CREATE TABLE "article"(
id SERIAL PRIMARY KEY,
name TEXT NOT NULL,
user_id INTEGER
);
INSERT INTO "article" (name, user_id) VALUES
('foo', 1),
('bar', 1),
('bar', 1),
('baz', 2);
allow custom mutations through actions (#3042) * basic doc for actions * custom_types, sync and async actions * switch to graphql-parser-hs on github * update docs * metadata import/export * webhook calls are now supported * relationships in sync actions * initialise.sql is now in sync with the migration file * fix metadata tests * allow specifying arguments of actions * fix blacklist check on check_build_worthiness job * track custom_types and actions related tables * handlers are now triggered on async actions * default to pgjson unless a field is involved in relationships, for generating definition list * use 'true' for action filter for non admin role * fix create_action_permission sql query * drop permissions when dropping an action * add a hdb_role view (and relationships) to fetch all roles in the system * rename 'webhook' key in action definition to 'handler' * allow templating actions wehook URLs with env vars * add 'update_action' /v1/query type * allow forwarding client headers by setting `forward_client_headers` in action definition * add 'headers' configuration in action definition * handle webhook error response based on status codes * support array relationships for custom types * implement single row mutation, see https://github.com/hasura/graphql-engine/issues/3731 * single row mutation: rename 'pk_columns' -> 'columns' and no-op refactor * use top level primary key inputs for delete_by_pk & account select permissions for single row mutations * use only REST semantics to resolve the webhook response * use 'pk_columns' instead of 'columns' for update_by_pk input * add python basic tests for single row mutations * add action context (name) in webhook payload * Async action response is accessible for non admin roles only if the request session vars equals to action's * clean nulls, empty arrays for actions, custom types in export metadata * async action mutation returns only the UUID of the action * unit tests for URL template parser * Basic sync actions python tests * fix output in async query & add async tests * add admin secret header in async actions python test * document async action architecture in Resolve/Action.hs file * support actions returning array of objects * tests for list type response actions * update docs with actions and custom types metadata API reference * update actions python tests as per #f8e1330 Co-authored-by: Tirumarai Selvan <tirumarai.selvan@gmail.com> Co-authored-by: Aravind Shankar <face11301@gmail.com> Co-authored-by: Rakesh Emmadi <12475069+rakeshkky@users.noreply.github.com>
2020-02-13 20:38:23 +03:00
- type: track_table
args:
name: user
schema: public
- type: track_table
args:
name: article
schema: public
allow custom mutations through actions (#3042) * basic doc for actions * custom_types, sync and async actions * switch to graphql-parser-hs on github * update docs * metadata import/export * webhook calls are now supported * relationships in sync actions * initialise.sql is now in sync with the migration file * fix metadata tests * allow specifying arguments of actions * fix blacklist check on check_build_worthiness job * track custom_types and actions related tables * handlers are now triggered on async actions * default to pgjson unless a field is involved in relationships, for generating definition list * use 'true' for action filter for non admin role * fix create_action_permission sql query * drop permissions when dropping an action * add a hdb_role view (and relationships) to fetch all roles in the system * rename 'webhook' key in action definition to 'handler' * allow templating actions wehook URLs with env vars * add 'update_action' /v1/query type * allow forwarding client headers by setting `forward_client_headers` in action definition * add 'headers' configuration in action definition * handle webhook error response based on status codes * support array relationships for custom types * implement single row mutation, see https://github.com/hasura/graphql-engine/issues/3731 * single row mutation: rename 'pk_columns' -> 'columns' and no-op refactor * use top level primary key inputs for delete_by_pk & account select permissions for single row mutations * use only REST semantics to resolve the webhook response * use 'pk_columns' instead of 'columns' for update_by_pk input * add python basic tests for single row mutations * add action context (name) in webhook payload * Async action response is accessible for non admin roles only if the request session vars equals to action's * clean nulls, empty arrays for actions, custom types in export metadata * async action mutation returns only the UUID of the action * unit tests for URL template parser * Basic sync actions python tests * fix output in async query & add async tests * add admin secret header in async actions python test * document async action architecture in Resolve/Action.hs file * support actions returning array of objects * tests for list type response actions * update docs with actions and custom types metadata API reference * update actions python tests as per #f8e1330 Co-authored-by: Tirumarai Selvan <tirumarai.selvan@gmail.com> Co-authored-by: Aravind Shankar <face11301@gmail.com> Co-authored-by: Rakesh Emmadi <12475069+rakeshkky@users.noreply.github.com>
2020-02-13 20:38:23 +03:00
- type: set_custom_types
args:
input_objects:
- name: UserInput
fields:
- name: name
type: String!
- name: email
type: String!
- name: parent
type: UserInput
allow custom mutations through actions (#3042) * basic doc for actions * custom_types, sync and async actions * switch to graphql-parser-hs on github * update docs * metadata import/export * webhook calls are now supported * relationships in sync actions * initialise.sql is now in sync with the migration file * fix metadata tests * allow specifying arguments of actions * fix blacklist check on check_build_worthiness job * track custom_types and actions related tables * handlers are now triggered on async actions * default to pgjson unless a field is involved in relationships, for generating definition list * use 'true' for action filter for non admin role * fix create_action_permission sql query * drop permissions when dropping an action * add a hdb_role view (and relationships) to fetch all roles in the system * rename 'webhook' key in action definition to 'handler' * allow templating actions wehook URLs with env vars * add 'update_action' /v1/query type * allow forwarding client headers by setting `forward_client_headers` in action definition * add 'headers' configuration in action definition * handle webhook error response based on status codes * support array relationships for custom types * implement single row mutation, see https://github.com/hasura/graphql-engine/issues/3731 * single row mutation: rename 'pk_columns' -> 'columns' and no-op refactor * use top level primary key inputs for delete_by_pk & account select permissions for single row mutations * use only REST semantics to resolve the webhook response * use 'pk_columns' instead of 'columns' for update_by_pk input * add python basic tests for single row mutations * add action context (name) in webhook payload * Async action response is accessible for non admin roles only if the request session vars equals to action's * clean nulls, empty arrays for actions, custom types in export metadata * async action mutation returns only the UUID of the action * unit tests for URL template parser * Basic sync actions python tests * fix output in async query & add async tests * add admin secret header in async actions python test * document async action architecture in Resolve/Action.hs file * support actions returning array of objects * tests for list type response actions * update docs with actions and custom types metadata API reference * update actions python tests as per #f8e1330 Co-authored-by: Tirumarai Selvan <tirumarai.selvan@gmail.com> Co-authored-by: Aravind Shankar <face11301@gmail.com> Co-authored-by: Rakesh Emmadi <12475069+rakeshkky@users.noreply.github.com>
2020-02-13 20:38:23 +03:00
- name: InObject
fields:
- name: id
type: ID
- name: name
type: String
- name: age
type: Int
- name: IntentionalErrorInput
fields:
- name: message
type: String!
- name: code
type: String
- name: extensions
type: json
scalars:
- name: myCustomScalar
allow custom mutations through actions (#3042) * basic doc for actions * custom_types, sync and async actions * switch to graphql-parser-hs on github * update docs * metadata import/export * webhook calls are now supported * relationships in sync actions * initialise.sql is now in sync with the migration file * fix metadata tests * allow specifying arguments of actions * fix blacklist check on check_build_worthiness job * track custom_types and actions related tables * handlers are now triggered on async actions * default to pgjson unless a field is involved in relationships, for generating definition list * use 'true' for action filter for non admin role * fix create_action_permission sql query * drop permissions when dropping an action * add a hdb_role view (and relationships) to fetch all roles in the system * rename 'webhook' key in action definition to 'handler' * allow templating actions wehook URLs with env vars * add 'update_action' /v1/query type * allow forwarding client headers by setting `forward_client_headers` in action definition * add 'headers' configuration in action definition * handle webhook error response based on status codes * support array relationships for custom types * implement single row mutation, see https://github.com/hasura/graphql-engine/issues/3731 * single row mutation: rename 'pk_columns' -> 'columns' and no-op refactor * use top level primary key inputs for delete_by_pk & account select permissions for single row mutations * use only REST semantics to resolve the webhook response * use 'pk_columns' instead of 'columns' for update_by_pk input * add python basic tests for single row mutations * add action context (name) in webhook payload * Async action response is accessible for non admin roles only if the request session vars equals to action's * clean nulls, empty arrays for actions, custom types in export metadata * async action mutation returns only the UUID of the action * unit tests for URL template parser * Basic sync actions python tests * fix output in async query & add async tests * add admin secret header in async actions python test * document async action architecture in Resolve/Action.hs file * support actions returning array of objects * tests for list type response actions * update docs with actions and custom types metadata API reference * update actions python tests as per #f8e1330 Co-authored-by: Tirumarai Selvan <tirumarai.selvan@gmail.com> Co-authored-by: Aravind Shankar <face11301@gmail.com> Co-authored-by: Rakesh Emmadi <12475069+rakeshkky@users.noreply.github.com>
2020-02-13 20:38:23 +03:00
objects:
- name: UserId
fields:
- name: id
type: Int!
relationships:
- name: user
type: object
remote_table: user
field_mapping:
id: id
- name: articles
type: array
remote_table: article
field_mapping:
id: user_id
allow custom mutations through actions (#3042) * basic doc for actions * custom_types, sync and async actions * switch to graphql-parser-hs on github * update docs * metadata import/export * webhook calls are now supported * relationships in sync actions * initialise.sql is now in sync with the migration file * fix metadata tests * allow specifying arguments of actions * fix blacklist check on check_build_worthiness job * track custom_types and actions related tables * handlers are now triggered on async actions * default to pgjson unless a field is involved in relationships, for generating definition list * use 'true' for action filter for non admin role * fix create_action_permission sql query * drop permissions when dropping an action * add a hdb_role view (and relationships) to fetch all roles in the system * rename 'webhook' key in action definition to 'handler' * allow templating actions wehook URLs with env vars * add 'update_action' /v1/query type * allow forwarding client headers by setting `forward_client_headers` in action definition * add 'headers' configuration in action definition * handle webhook error response based on status codes * support array relationships for custom types * implement single row mutation, see https://github.com/hasura/graphql-engine/issues/3731 * single row mutation: rename 'pk_columns' -> 'columns' and no-op refactor * use top level primary key inputs for delete_by_pk & account select permissions for single row mutations * use only REST semantics to resolve the webhook response * use 'pk_columns' instead of 'columns' for update_by_pk input * add python basic tests for single row mutations * add action context (name) in webhook payload * Async action response is accessible for non admin roles only if the request session vars equals to action's * clean nulls, empty arrays for actions, custom types in export metadata * async action mutation returns only the UUID of the action * unit tests for URL template parser * Basic sync actions python tests * fix output in async query & add async tests * add admin secret header in async actions python test * document async action architecture in Resolve/Action.hs file * support actions returning array of objects * tests for list type response actions * update docs with actions and custom types metadata API reference * update actions python tests as per #f8e1330 Co-authored-by: Tirumarai Selvan <tirumarai.selvan@gmail.com> Co-authored-by: Aravind Shankar <face11301@gmail.com> Co-authored-by: Rakesh Emmadi <12475069+rakeshkky@users.noreply.github.com>
2020-02-13 20:38:23 +03:00
- name: UserId2
fields:
- name: id
type: Int!
- name: OutObject
fields:
- name: id
type: ID! # For issue https://github.com/hasura/graphql-engine/issues/4061
- name: name
type: String
- name: Headers
fields:
- name: name
type: String!
- name: value
type: String!
- name: OutHeaders
fields:
- name: headers
type: '[Headers]'
- name: OutObjectTransformed
fields:
- name: foo
type: ID!
- name: bar
type: String
- name: OutObjectScalarTransformed
fields:
- name: foo
type: String!
- name: Address
fields:
- name: city
type: String
- name: country
type: String
- name: NestedOutObject
fields:
- name: id
type: Int!
- name: user_id
type: UserId2
- name: address
type: Address
- name: addresses
type: '[Address]'
- name: NestedOutObjectTransformed
fields:
- name: uid
type: ID!
- name: city0
type: String
- name: country0
type: String
- name: other_addresses
type: '[Address]'
- name: NestedJoinObject
fields:
- name: id
type: Int!
- name: user_id
type: UserId
- name: address
type: Address
- name: addresses
type: '[Address]'
- name: DirectRecursiveType
fields:
- name: id
type: Int!
- name: this
type: DirectRecursiveType
- name: ListRecursiveType
fields:
- name: id
type: Int!
- name: these
type: '[ListRecursiveType]'
- name: MutuallyRecursiveTypeA
fields:
- name: id
type: Int!
- name: that
type: MutuallyRecursiveTypeB
- name: MutuallyRecursiveTypeB
fields:
- name: id
type: Int!
- name: other
type: MutuallyRecursiveTypeA
- name: Recursive
fields:
- name: direct
type: DirectRecursiveType
- name: list
type: ListRecursiveType
- name: mutual
type: MutuallyRecursiveTypeA
- name: NullableResp
fields:
- name: id
type: Int!
- name: ResultIdList
fields:
- name: result_ids
type: '[Int!]!'
- name: Result
fields:
- name: id
type: Int!
- name: TypedNestedNull
fields:
- name: id
type: ID!
- name: child
type: TypedNestedNull
allow custom mutations through actions (#3042) * basic doc for actions * custom_types, sync and async actions * switch to graphql-parser-hs on github * update docs * metadata import/export * webhook calls are now supported * relationships in sync actions * initialise.sql is now in sync with the migration file * fix metadata tests * allow specifying arguments of actions * fix blacklist check on check_build_worthiness job * track custom_types and actions related tables * handlers are now triggered on async actions * default to pgjson unless a field is involved in relationships, for generating definition list * use 'true' for action filter for non admin role * fix create_action_permission sql query * drop permissions when dropping an action * add a hdb_role view (and relationships) to fetch all roles in the system * rename 'webhook' key in action definition to 'handler' * allow templating actions wehook URLs with env vars * add 'update_action' /v1/query type * allow forwarding client headers by setting `forward_client_headers` in action definition * add 'headers' configuration in action definition * handle webhook error response based on status codes * support array relationships for custom types * implement single row mutation, see https://github.com/hasura/graphql-engine/issues/3731 * single row mutation: rename 'pk_columns' -> 'columns' and no-op refactor * use top level primary key inputs for delete_by_pk & account select permissions for single row mutations * use only REST semantics to resolve the webhook response * use 'pk_columns' instead of 'columns' for update_by_pk input * add python basic tests for single row mutations * add action context (name) in webhook payload * Async action response is accessible for non admin roles only if the request session vars equals to action's * clean nulls, empty arrays for actions, custom types in export metadata * async action mutation returns only the UUID of the action * unit tests for URL template parser * Basic sync actions python tests * fix output in async query & add async tests * add admin secret header in async actions python test * document async action architecture in Resolve/Action.hs file * support actions returning array of objects * tests for list type response actions * update docs with actions and custom types metadata API reference * update actions python tests as per #f8e1330 Co-authored-by: Tirumarai Selvan <tirumarai.selvan@gmail.com> Co-authored-by: Aravind Shankar <face11301@gmail.com> Co-authored-by: Rakesh Emmadi <12475069+rakeshkky@users.noreply.github.com>
2020-02-13 20:38:23 +03:00
- type: create_action
args:
name: create_user
definition:
kind: synchronous
arguments:
- name: email
type: String!
- name: name
type: String!
output_type: UserId
handler: "{{ACTION_WEBHOOK_HANDLER}}/create-user"
allow custom mutations through actions (#3042) * basic doc for actions * custom_types, sync and async actions * switch to graphql-parser-hs on github * update docs * metadata import/export * webhook calls are now supported * relationships in sync actions * initialise.sql is now in sync with the migration file * fix metadata tests * allow specifying arguments of actions * fix blacklist check on check_build_worthiness job * track custom_types and actions related tables * handlers are now triggered on async actions * default to pgjson unless a field is involved in relationships, for generating definition list * use 'true' for action filter for non admin role * fix create_action_permission sql query * drop permissions when dropping an action * add a hdb_role view (and relationships) to fetch all roles in the system * rename 'webhook' key in action definition to 'handler' * allow templating actions wehook URLs with env vars * add 'update_action' /v1/query type * allow forwarding client headers by setting `forward_client_headers` in action definition * add 'headers' configuration in action definition * handle webhook error response based on status codes * support array relationships for custom types * implement single row mutation, see https://github.com/hasura/graphql-engine/issues/3731 * single row mutation: rename 'pk_columns' -> 'columns' and no-op refactor * use top level primary key inputs for delete_by_pk & account select permissions for single row mutations * use only REST semantics to resolve the webhook response * use 'pk_columns' instead of 'columns' for update_by_pk input * add python basic tests for single row mutations * add action context (name) in webhook payload * Async action response is accessible for non admin roles only if the request session vars equals to action's * clean nulls, empty arrays for actions, custom types in export metadata * async action mutation returns only the UUID of the action * unit tests for URL template parser * Basic sync actions python tests * fix output in async query & add async tests * add admin secret header in async actions python test * document async action architecture in Resolve/Action.hs file * support actions returning array of objects * tests for list type response actions * update docs with actions and custom types metadata API reference * update actions python tests as per #f8e1330 Co-authored-by: Tirumarai Selvan <tirumarai.selvan@gmail.com> Co-authored-by: Aravind Shankar <face11301@gmail.com> Co-authored-by: Rakesh Emmadi <12475069+rakeshkky@users.noreply.github.com>
2020-02-13 20:38:23 +03:00
- type: create_action
args:
name: create_users
definition:
kind: synchronous
arguments:
- name: users
type: '[UserInput!]!'
output_type: '[UserId]'
handler: "{{ACTION_WEBHOOK_HANDLER}}/create-users"
- type: create_action
args:
name: mirror
definition:
kind: synchronous
arguments:
- name: arg
type: InObject!
output_type: OutObject
handler: "{{ACTION_WEBHOOK_HANDLER}}/mirror-action"
- type: create_action
args:
name: mirror_transformed
definition:
kind: synchronous
arguments:
- name: arg
type: InObject!
output_type: OutObject
handler: "{{ACTION_WEBHOOK_HANDLER}}/mirror-action"
- type: update_action
args:
name: mirror_transformed
definition:
kind: synchronous
arguments:
- name: arg
type: InObject!
output_type: OutObject
handler: "{{ACTION_WEBHOOK_HANDLER}}/mirror-action"
request_transform:
version: 2
template_engine: Kriti
body:
action: transform
template: |
{
"input": {
"arg": {
"id": {{ $body.input.arg.name }},
"name": {{ $body.input.arg.id }}
}
}
}
- type: create_action
args:
name: mirror_transformed_output
definition:
kind: synchronous
arguments:
- name: arg
type: InObject!
output_type: OutObjectTransformed
handler: "{{ACTION_WEBHOOK_HANDLER}}/mirror-action"
- type: update_action
args:
name: mirror_transformed_output
definition:
kind: synchronous
arguments:
- name: arg
type: InObject!
output_type: OutObjectTransformed
handler: "{{ACTION_WEBHOOK_HANDLER}}/mirror-action"
response_transform:
version: 2
template_engine: Kriti
body:
action: transform
template: |
{
"foo": {{ $body.id }},
"bar": {{ $body.name }}
}
- type: create_action
args:
name: mirror_headers
definition:
type: query
output_type: OutHeaders
handler: "{{ACTION_WEBHOOK_HANDLER}}/mirror-headers"
- type: create_action
args:
name: get_user_by_email
definition:
type: query
arguments:
- name: email
type: String!
output_type: UserId!
handler: "{{ACTION_WEBHOOK_HANDLER}}/get-user-by-email"
- type: create_action
args:
name: get_user_by_email_nested
definition:
type: query
arguments:
- name: email
type: String!
output_type: NestedOutObject!
handler: "{{ACTION_WEBHOOK_HANDLER}}/get-user-by-email-nested"
- type: create_action
args:
name: get_user_by_email_nested_transformed
definition:
type: query
arguments:
- name: email
type: String!
output_type: NestedOutObjectTransformed!
handler: "{{ACTION_WEBHOOK_HANDLER}}/get-user-by-email-nested"
response_transform:
version: 2
template_engine: Kriti
body:
action: transform
template: |
{
"uid": {{ $body.user_id.id }},
"city0": {{ $body.addresses[0].city }},
"country0": {{ $body.addresses[0].country }},
"other_addresses":
{{ range i, x := $body.addresses }}
{{ if i > 0 }}
{
"city": {{ x.city }},
"country": {{ x.country }}
}
{{ else }}
null
{{ end }}
{{ end }}
}
- type: create_action
args:
name: get_user_by_email_nested_join
definition:
type: query
arguments:
- name: email
type: String!
output_type: NestedJoinObject!
handler: "{{ACTION_WEBHOOK_HANDLER}}/get-user-by-email-nested"
- type: create_action
args:
name: get_users_by_email
definition:
type: query
arguments:
- name: email
type: String!
output_type: '[UserId]!'
handler: "{{ACTION_WEBHOOK_HANDLER}}/get-users-by-email"
- type: create_action
args:
name: get_users_by_email_nested
definition:
type: query
arguments:
- name: email
type: String!
output_type: '[NestedOutObject]!'
handler: "{{ACTION_WEBHOOK_HANDLER}}/get-users-by-email-nested"
- type: create_action
args:
name: intentional_error
definition:
type: query
arguments:
- name: blob
type: IntentionalErrorInput!
# this can be anything, since this action never succeeds
output_type: '[UserId]!'
handler: "{{ACTION_WEBHOOK_HANDLER}}/intentional-error"
- type: create_action
args:
name: null_response
definition:
kind: synchronous
arguments:
output_type: NullableResp
handler: "{{ACTION_WEBHOOK_HANDLER}}/null-response"
- type: create_action
args:
name: scalar_response
definition:
kind: synchronous
arguments:
output_type: String!
handler: "{{ACTION_WEBHOOK_HANDLER}}/scalar-response"
- type: create_action
args:
name: pgscalar_response
definition:
kind: synchronous
arguments:
output_type: json!
handler: "{{ACTION_WEBHOOK_HANDLER}}/json-response"
- type: create_action
args:
name: custom_scalar_response
definition:
kind: synchronous
arguments:
output_type: myCustomScalar!
handler: "{{ACTION_WEBHOOK_HANDLER}}/json-response"
- type: create_action
args:
name: scalar_array_response
definition:
kind: synchronous
arguments:
output_type: '[String]!'
handler: "{{ACTION_WEBHOOK_HANDLER}}/scalar-array-response"
- type: create_action
args:
name: custom_scalar_array_response
definition:
kind: synchronous
arguments:
output_type: '[myCustomScalar!]!'
handler: "{{ACTION_WEBHOOK_HANDLER}}/custom-scalar-array-response"
- type: create_action
args:
name: custom_scalar_nested_array_response
definition:
kind: synchronous
arguments:
output_type: '[[myCustomScalar!]]!'
handler: "{{ACTION_WEBHOOK_HANDLER}}/custom-scalar-array-response"
- type: create_select_permission
args:
table: user
role: user
permission:
columns:
- id
- name
- email
filter:
id: X-Hasura-User-Id
- type: create_action_permission
args:
action: get_user_by_email
role: user
- type: create_action
args:
name: recursive_output
definition:
type: query
output_type: Recursive
handler: "{{ACTION_WEBHOOK_HANDLER}}/recursive-output"
- type: create_action
args:
name: result_list
definition:
type: query
output_type: 'ResultIdList'
handler: "{{ACTION_WEBHOOK_HANDLER}}/get-results"
- type: create_action
args:
name: results
definition:
type: query
output_type: '[Result]'
handler: "{{ACTION_WEBHOOK_HANDLER}}/get-results"
response_transform:
version: 2
template_engine: Kriti
body:
action: transform
template: |
{{ range i, x := $body.result_ids }}
{
"id": {{ x }}
}
{{ end }}
- type: create_action
args:
name: typed_nested_null
definition:
type: query
output_type: TypedNestedNull!
handler: "{{ACTION_WEBHOOK_HANDLER}}/typed-nested-null"
- type: create_action
args:
name: typed_nested_null_wrong_field
definition:
type: query
output_type: TypedNestedNull!
handler: "{{ACTION_WEBHOOK_HANDLER}}/typed-nested-null-wrong-field"