@Generated(value="jsii-pacmak/1.58.0 (build f8ba112)", date="2022-05-11T19:24:24.899Z") @Stability(value=Experimental) public class Values extends software.amazon.jsii.JsiiObject
Example:
GraphqlApi api = GraphqlApi.Builder.create(this, "Api")
.name("demo")
.schema(Schema.fromAsset(join(__dirname, "schema.graphql")))
.authorizationConfig(AuthorizationConfig.builder()
.defaultAuthorization(AuthorizationMode.builder()
.authorizationType(AuthorizationType.IAM)
.build())
.build())
.xrayEnabled(true)
.build();
Table demoTable = Table.Builder.create(this, "DemoTable")
.partitionKey(Attribute.builder()
.name("id")
.type(AttributeType.STRING)
.build())
.build();
DynamoDbDataSource demoDS = api.addDynamoDbDataSource("demoDataSource", demoTable);
// Resolver for the Query "getDemos" that scans the DynamoDb table and returns the entire list.
demoDS.createResolver(BaseResolverProps.builder()
.typeName("Query")
.fieldName("getDemos")
.requestMappingTemplate(MappingTemplate.dynamoDbScanTable())
.responseMappingTemplate(MappingTemplate.dynamoDbResultList())
.build());
// Resolver for the Mutation "addDemo" that puts the item into the DynamoDb table.
demoDS.createResolver(BaseResolverProps.builder()
.typeName("Mutation")
.fieldName("addDemo")
.requestMappingTemplate(MappingTemplate.dynamoDbPutItem(PrimaryKey.partition("id").auto(), Values.projecting("input")))
.responseMappingTemplate(MappingTemplate.dynamoDbResultItem())
.build());
| Modifier | Constructor and Description |
|---|---|
|
Values() |
protected |
Values(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
Values(software.amazon.jsii.JsiiObjectRef objRef) |
| Modifier and Type | Method and Description |
|---|---|
static AttributeValuesStep |
attribute(String attr)
(experimental) Allows assigning a value to the specified attribute.
|
static AttributeValues |
projecting()
(experimental) Treats the specified object as a map of assignments, where the property names represent attribute names.
|
static AttributeValues |
projecting(String arg)
(experimental) Treats the specified object as a map of assignments, where the property names represent attribute names.
|
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetprotected Values(software.amazon.jsii.JsiiObjectRef objRef)
protected Values(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Experimental) public Values()
@Stability(value=Experimental) @NotNull public static AttributeValuesStep attribute(@NotNull String attr)
attr - This parameter is required.@Stability(value=Experimental) @NotNull public static AttributeValues projecting(@Nullable String arg)
It’s opinionated about how it represents some of the nested objects: e.g., it will use lists (“L”) rather than sets (“SS”, “NS”, “BS”). By default it projects the argument container ("$ctx.args").
arg - @Stability(value=Experimental) @NotNull public static AttributeValues projecting()
It’s opinionated about how it represents some of the nested objects: e.g., it will use lists (“L”) rather than sets (“SS”, “NS”, “BS”). By default it projects the argument container ("$ctx.args").
Copyright © 2022. All rights reserved.