Class MappingTemplate
(experimental) MappingTemplates for AppSync resolvers.
Inheritance
Namespace: Amazon.CDK.AWS.AppSync
Assembly: Amazon.CDK.AWS.AppSync.dll
Syntax (csharp)
public abstract class MappingTemplate : DeputyBase
Syntax (vb)
Public MustInherit Class MappingTemplate
Inherits DeputyBase
Remarks
Stability: Experimental
ExampleMetadata: infused
Examples
GraphqlApi api;
MappingTemplate dummyRequest;
MappingTemplate dummyResponse;
var info = new ObjectType("Info", new ObjectTypeOptions {
Definition = new Dictionary<string, IField> {
{ "node", new ResolvableField(new ResolvableFieldOptions {
ReturnType = GraphqlType.String(),
Args = new Dictionary<string, GraphqlType> {
{ "id", GraphqlType.String() }
},
DataSource = api.AddNoneDataSource("none"),
RequestMappingTemplate = dummyRequest,
ResponseMappingTemplate = dummyResponse
}) }
}
});
Synopsis
Constructors
MappingTemplate() | |
MappingTemplate(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
MappingTemplate(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
Methods
DynamoDbDeleteItem(String, String) | (experimental) Mapping template to delete a single item from a DynamoDB table. |
DynamoDbGetItem(String, String) | (experimental) Mapping template to get a single item from a DynamoDB table. |
DynamoDbPutItem(PrimaryKey, AttributeValues) | (experimental) Mapping template to save a single item to a DynamoDB table. |
DynamoDbQuery(KeyCondition, String) | (experimental) Mapping template to query a set of items from a DynamoDB table. |
DynamoDbResultItem() | (experimental) Mapping template for a single result item from DynamoDB. |
DynamoDbResultList() | (experimental) Mapping template for a result list from DynamoDB. |
DynamoDbScanTable() | (experimental) Mapping template to scan a DynamoDB table to fetch all entries. |
FromFile(String) | (experimental) Create a mapping template from the given file. |
FromString(String) | (experimental) Create a mapping template from the given string. |
LambdaRequest(String, String) | (experimental) Mapping template to invoke a Lambda function. |
LambdaResult() | (experimental) Mapping template to return the Lambda result to the caller. |
RenderTemplate() | (experimental) this is called to render the mapping template to a VTL string. |
Constructors
MappingTemplate()
protected MappingTemplate()
Remarks
Stability: Experimental
MappingTemplate(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected MappingTemplate(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
MappingTemplate(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected MappingTemplate(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
Methods
DynamoDbDeleteItem(String, String)
(experimental) Mapping template to delete a single item from a DynamoDB table.
public static MappingTemplate DynamoDbDeleteItem(string keyName, string idArg)
Parameters
- keyName System.String
the name of the hash key field.
- idArg System.String
the name of the Mutation argument.
Returns
Remarks
Stability: Experimental
DynamoDbGetItem(String, String)
(experimental) Mapping template to get a single item from a DynamoDB table.
public static MappingTemplate DynamoDbGetItem(string keyName, string idArg)
Parameters
- keyName System.String
the name of the hash key field.
- idArg System.String
the name of the Query argument.
Returns
Remarks
Stability: Experimental
DynamoDbPutItem(PrimaryKey, AttributeValues)
(experimental) Mapping template to save a single item to a DynamoDB table.
public static MappingTemplate DynamoDbPutItem(PrimaryKey key, AttributeValues values)
Parameters
- key PrimaryKey
the assigment of Mutation values to the primary key.
- values AttributeValues
the assignment of Mutation values to the table attributes.
Returns
Remarks
Stability: Experimental
DynamoDbQuery(KeyCondition, String)
(experimental) Mapping template to query a set of items from a DynamoDB table.
public static MappingTemplate DynamoDbQuery(KeyCondition cond, string indexName = null)
Parameters
- cond KeyCondition
the key condition for the query.
- indexName System.String
the key condition for the query.
Returns
Remarks
Stability: Experimental
DynamoDbResultItem()
(experimental) Mapping template for a single result item from DynamoDB.
public static MappingTemplate DynamoDbResultItem()
Returns
Remarks
Stability: Experimental
DynamoDbResultList()
(experimental) Mapping template for a result list from DynamoDB.
public static MappingTemplate DynamoDbResultList()
Returns
Remarks
Stability: Experimental
DynamoDbScanTable()
(experimental) Mapping template to scan a DynamoDB table to fetch all entries.
public static MappingTemplate DynamoDbScanTable()
Returns
Remarks
Stability: Experimental
FromFile(String)
(experimental) Create a mapping template from the given file.
public static MappingTemplate FromFile(string fileName)
Parameters
- fileName System.String
Returns
Remarks
Stability: Experimental
FromString(String)
(experimental) Create a mapping template from the given string.
public static MappingTemplate FromString(string template)
Parameters
- template System.String
Returns
Remarks
Stability: Experimental
LambdaRequest(String, String)
(experimental) Mapping template to invoke a Lambda function.
public static MappingTemplate LambdaRequest(string payload = null, string operation = null)
Parameters
- payload System.String
the VTL template snippet of the payload to send to the lambda.
- operation System.String
the type of operation AppSync should perform on the data source.
Returns
Remarks
Stability: Experimental
LambdaResult()
(experimental) Mapping template to return the Lambda result to the caller.
public static MappingTemplate LambdaResult()
Returns
Remarks
Stability: Experimental
RenderTemplate()
(experimental) this is called to render the mapping template to a VTL string.
public abstract string RenderTemplate()
Returns
System.String
Remarks
Stability: Experimental