interface ResolvableFieldOptions
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.AppSync.ResolvableFieldOptions |
Java | software.amazon.awscdk.services.appsync.ResolvableFieldOptions |
Python | aws_cdk.aws_appsync.ResolvableFieldOptions |
TypeScript (source) | @aws-cdk/aws-appsync » ResolvableFieldOptions |
Properties for configuring a resolvable field.
Example
declare const api: appsync.GraphqlApi;
declare const filmNode: appsync.ObjectType;
declare const dummyRequest: appsync.MappingTemplate;
declare const dummyResponse: appsync.MappingTemplate;
const string = appsync.GraphqlType.string();
const int = appsync.GraphqlType.int();
api.addMutation('addFilm', new appsync.ResolvableField({
returnType: filmNode.attribute(),
args: { name: string, film_number: int },
dataSource: api.addNoneDataSource('none'),
requestMappingTemplate: dummyRequest,
responseMappingTemplate: dummyResponse,
}));
Properties
Name | Type | Description |
---|---|---|
return | Graphql | The return type for this field. |
args? | { [string]: Graphql } | The arguments for this field. |
data | Base | The data source creating linked to this resolvable field. |
directives? | Directive [] | the directives for this field. |
pipeline | IAppsync [] | configuration of the pipeline resolver. |
request | Mapping | The request mapping template for this resolver. |
response | Mapping | The response mapping template for this resolver. |
returnType
Type:
Graphql
The return type for this field.
args?
Type:
{ [string]:
Graphql
}
(optional, default: no arguments)
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
dataSource?
Type:
Base
(optional, default: no data source)
The data source creating linked to this resolvable field.
directives?
Type:
Directive
[]
(optional, default: no directives)
the directives for this field.
pipelineConfig?
Type:
IAppsync
[]
(optional, default: no pipeline resolver configuration
An empty array or undefined prop will set resolver to be of type unit)
configuration of the pipeline resolver.
requestMappingTemplate?
Type:
Mapping
(optional, default: No mapping template)
The request mapping template for this resolver.
responseMappingTemplate?
Type:
Mapping
(optional, default: No mapping template)
The response mapping template for this resolver.