Interface BaseResolverProps
- All Superinterfaces:
software.amazon.jsii.JsiiSerializable
- All Known Subinterfaces:
ExtendedResolverProps
,ResolverProps
- All Known Implementing Classes:
BaseResolverProps.Jsii$Proxy
,ExtendedResolverProps.Jsii$Proxy
,ResolverProps.Jsii$Proxy
@Generated(value="jsii-pacmak/1.104.0 (build e79254c)",
date="2024-11-22T02:23:57.089Z")
@Stability(Stable)
public interface BaseResolverProps
extends software.amazon.jsii.JsiiSerializable
Basic properties for an AppSync resolver.
Example:
// Build a data source for AppSync to access the database. GraphqlApi api; // Create username and password secret for DB Cluster DatabaseSecret secret = DatabaseSecret.Builder.create(this, "AuroraSecret") .username("clusteradmin") .build(); // The VPC to place the cluster in Vpc vpc = new Vpc(this, "AuroraVpc"); // Create the serverless cluster, provide all values needed to customise the database. ServerlessCluster cluster = ServerlessCluster.Builder.create(this, "AuroraCluster") .engine(DatabaseClusterEngine.AURORA_MYSQL) .vpc(vpc) .credentials(Map.of("username", "clusteradmin")) .clusterIdentifier("db-endpoint-test") .defaultDatabaseName("demos") .build(); RdsDataSource rdsDS = api.addRdsDataSource("rds", cluster, secret, "demos"); // Set up a resolver for an RDS query. rdsDS.createResolver("QueryGetDemosRdsResolver", BaseResolverProps.builder() .typeName("Query") .fieldName("getDemosRds") .requestMappingTemplate(MappingTemplate.fromString("\n {\n \"version\": \"2018-05-29\",\n \"statements\": [\n \"SELECT * FROM demos\"\n ]\n }\n ")) .responseMappingTemplate(MappingTemplate.fromString("\n $utils.toJson($utils.rds.toJsonObject($ctx.result)[0])\n ")) .build()); // Set up a resolver for an RDS mutation. rdsDS.createResolver("MutationAddDemoRdsResolver", BaseResolverProps.builder() .typeName("Mutation") .fieldName("addDemoRds") .requestMappingTemplate(MappingTemplate.fromString("\n {\n \"version\": \"2018-05-29\",\n \"statements\": [\n \"INSERT INTO demos VALUES (:id, :version)\",\n \"SELECT * WHERE id = :id\"\n ],\n \"variableMap\": {\n \":id\": $util.toJson($util.autoId()),\n \":version\": $util.toJson($ctx.args.version)\n }\n }\n ")) .responseMappingTemplate(MappingTemplate.fromString("\n $utils.toJson($utils.rds.toJsonObject($ctx.result)[1][0])\n ")) .build());
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic final class
A builder forBaseResolverProps
static final class
An implementation forBaseResolverProps
-
Method Summary
Modifier and TypeMethodDescriptionstatic BaseResolverProps.Builder
builder()
default CachingConfig
The caching configuration for this resolver.default Code
getCode()
The function code.name of the GraphQL field in the given type this resolver is attached to.default Number
The maximum number of elements per batch, when using batch invoke.default List<IAppsyncFunction>
configuration of the pipeline resolver.default MappingTemplate
The request mapping template for this resolver.default MappingTemplate
The response mapping template for this resolver.default FunctionRuntime
The functions runtime.name of the GraphQL type this resolver is attached to.Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Method Details
-
getFieldName
name of the GraphQL field in the given type this resolver is attached to. -
getTypeName
name of the GraphQL type this resolver is attached to. -
getCachingConfig
The caching configuration for this resolver.Default: - No caching configuration
-
getCode
The function code.Default: - no code is used
-
getMaxBatchSize
The maximum number of elements per batch, when using batch invoke.Default: - No max batch size
-
getPipelineConfig
configuration of the pipeline resolver.Default: - no pipeline resolver configuration An empty array | undefined sets resolver to be of kind, unit
-
getRequestMappingTemplate
The request mapping template for this resolver.Default: - No mapping template
-
getResponseMappingTemplate
The response mapping template for this resolver.Default: - No mapping template
-
getRuntime
The functions runtime.Default: - no function runtime, VTL mapping templates used
-
builder
- Returns:
- a
BaseResolverProps.Builder
ofBaseResolverProps
-