# BaseAppsyncFunctionProps

the base properties for AppSync Functions.

- Source: [`aws-appsync/lib/appsync-function.ts`](https://github.com/aws/aws-cdk/blob/v2.277.0/packages/aws-cdk-lib/aws-appsync/lib/appsync-function.ts#L19)
- Type last changed: v2.146.0 · 13 Jun 2024

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_appsync as appsync } from 'aws-cdk-lib';

declare const code: appsync.Code;
declare const functionRuntime: appsync.FunctionRuntime;
declare const mappingTemplate: appsync.MappingTemplate;
const baseAppsyncFunctionProps: appsync.BaseAppsyncFunctionProps = {
  name: 'name',

  // the properties below are optional
  code: code,
  description: 'description',
  maxBatchSize: 123,
  requestMappingTemplate: mappingTemplate,
  responseMappingTemplate: mappingTemplate,
  runtime: functionRuntime,
};
```

Python:

```python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_appsync as appsync

# code: appsync.Code
# function_runtime: appsync.FunctionRuntime
# mapping_template: appsync.MappingTemplate

base_appsync_function_props = appsync.BaseAppsyncFunctionProps(
    name="name",

    # the properties below are optional
    code=code,
    description="description",
    max_batch_size=123,
    request_mapping_template=mapping_template,
    response_mapping_template=mapping_template,
    runtime=function_runtime
)
```

Java:

```java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.appsync.*;

Code code;
FunctionRuntime functionRuntime;
MappingTemplate mappingTemplate;

BaseAppsyncFunctionProps baseAppsyncFunctionProps = BaseAppsyncFunctionProps.builder()
        .name("name")

        // the properties below are optional
        .code(code)
        .description("description")
        .maxBatchSize(123)
        .requestMappingTemplate(mappingTemplate)
        .responseMappingTemplate(mappingTemplate)
        .runtime(functionRuntime)
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.AppSync;

Code code;
FunctionRuntime functionRuntime;
MappingTemplate mappingTemplate;

var baseAppsyncFunctionProps = new BaseAppsyncFunctionProps {
    Name = "name",

    // the properties below are optional
    Code = code,
    Description = "description",
    MaxBatchSize = 123,
    RequestMappingTemplate = mappingTemplate,
    ResponseMappingTemplate = mappingTemplate,
    Runtime = functionRuntime
};
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

var code Code
var functionRuntime FunctionRuntime
var mappingTemplate MappingTemplate

baseAppsyncFunctionProps := &BaseAppsyncFunctionProps{
	Name: jsii.String("name"),

	// the properties below are optional
	Code: code,
	Description: jsii.String("description"),
	MaxBatchSize: jsii.Number(123),
	RequestMappingTemplate: mappingTemplate,
	ResponseMappingTemplate: mappingTemplate,
	Runtime: functionRuntime,
}
```

## Properties

- `code`: [Code](/cdk/api/v2/docs/aws-cdk-lib.aws_appsync.Code.html) — The function code.

  **Default:** no code is used

- `description`: string — the description for this AppSync Function.

  **Default:** no description

- `maxBatchSize`: number — The maximum number of resolver request inputs that will be sent to a single AWS Lambda function in a BatchInvoke operation.

  **Default:** No max batch size

  Can only be set when using LambdaDataSource.

- `name`: string (required) — the name of the AppSync Function.

- `requestMappingTemplate`: [MappingTemplate](/cdk/api/v2/docs/aws-cdk-lib.aws_appsync.MappingTemplate.html) — the request mapping template for the AppSync Function.

  **Default:** no request mapping template

- `responseMappingTemplate`: [MappingTemplate](/cdk/api/v2/docs/aws-cdk-lib.aws_appsync.MappingTemplate.html) — the response mapping template for the AppSync Function.

  **Default:** no response mapping template

- `runtime`: [FunctionRuntime](/cdk/api/v2/docs/aws-cdk-lib.aws_appsync.FunctionRuntime.html) — The functions runtime.

  **Default:** no function runtime, VTL mapping templates used
