ResolvableFieldOptions

class aws_cdk.aws_appsync.ResolvableFieldOptions(*, return_type, args=None, directives=None, data_source=None, pipeline_config=None, request_mapping_template=None, response_mapping_template=None)

Bases: FieldOptions

(experimental) Properties for configuring a resolvable field.

Parameters:
  • return_type (GraphqlType) – (experimental) The return type for this field.

  • args (Optional[Mapping[str, GraphqlType]]) – (experimental) The arguments for this field. i.e. type Example (first: String second: String) {} - where ‘first’ and ‘second’ are key values for args and ‘String’ is the GraphqlType Default: - no arguments

  • directives (Optional[Sequence[Directive]]) – (experimental) the directives for this field. Default: - no directives

  • data_source (Optional[BaseDataSource]) – (experimental) The data source creating linked to this resolvable field. Default: - no data source

  • pipeline_config (Optional[Sequence[IAppsyncFunction]]) – (experimental) configuration of the pipeline resolver. Default: - no pipeline resolver configuration An empty array or undefined prop will set resolver to be of type unit

  • request_mapping_template (Optional[MappingTemplate]) – (experimental) The request mapping template for this resolver. Default: - No mapping template

  • response_mapping_template (Optional[MappingTemplate]) – (experimental) The response mapping template for this resolver. Default: - No mapping template

Stability:

experimental

Options:

responseMappingTemplate - the mapping template for responses from this resolver

ExampleMetadata:

infused

Example:

# api: appsync.GraphqlApi
# film_node: appsync.ObjectType
# dummy_request: appsync.MappingTemplate
# dummy_response: appsync.MappingTemplate


string = appsync.GraphqlType.string()
int = appsync.GraphqlType.int()
api.add_mutation("addFilm", appsync.ResolvableField(
    return_type=film_node.attribute(),
    args={"name": string, "film_number": int},
    data_source=api.add_none_data_source("none"),
    request_mapping_template=dummy_request,
    response_mapping_template=dummy_response
))

Attributes

args

(experimental) The arguments for this field.

i.e. type Example (first: String second: String) {}

  • where ‘first’ and ‘second’ are key values for args and ‘String’ is the GraphqlType

Default:
  • no arguments

Stability:

experimental

data_source

(experimental) The data source creating linked to this resolvable field.

Default:
  • no data source

Stability:

experimental

directives

(experimental) the directives for this field.

Default:
  • no directives

Stability:

experimental

pipeline_config

(experimental) configuration of the pipeline resolver.

Default:

  • no pipeline resolver configuration

An empty array or undefined prop will set resolver to be of type unit

Stability:

experimental

request_mapping_template

(experimental) The request mapping template for this resolver.

Default:
  • No mapping template

Stability:

experimental

response_mapping_template

(experimental) The response mapping template for this resolver.

Default:
  • No mapping template

Stability:

experimental

return_type

(experimental) The return type for this field.

Stability:

experimental