# AppsyncFunctionProps

the CDK properties for AppSync Functions.

Extends: AppsyncFunctionProps
Extends: BaseAppsyncFunctionProps

- Source: [`aws-appsync/lib/appsync-function.ts`](https://github.com/aws/aws-cdk/blob/v2.273.0/packages/aws-cdk-lib/aws-appsync/lib/appsync-function.ts#L74)
- Type last changed: v2.60.0 · 12 Jan 2023

## Example

```ts
declare const api: appsync.GraphqlApi;

const appsyncFunction = new appsync.AppsyncFunction(this, 'function', {
  name: 'appsync_function',
  api,
  dataSource: api.addNoneDataSource('none'),
  requestMappingTemplate: appsync.MappingTemplate.fromFile('request.vtl'),
  responseMappingTemplate: appsync.MappingTemplate.fromFile('response.vtl'),
});
```

## Properties

- `api`: [IGraphqlApi](/cdk/api/v2/docs/aws-cdk-lib.aws_appsync.IGraphqlApi.html) (required) — the GraphQL Api linked to this AppSync Function.

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

- `dataSource`: [BaseDataSource](/cdk/api/v2/docs/aws-cdk-lib.aws_appsync.BaseDataSource.html) (required) — the data source linked to this AppSync Function.

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

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

  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) = no request mapping template — the request mapping template for the AppSync Function.

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

- `runtime`: [FunctionRuntime](/cdk/api/v2/docs/aws-cdk-lib.aws_appsync.FunctionRuntime.html) = no function runtime, VTL mapping templates used — The functions runtime.

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

## Used as props by

- [`AppsyncFunction`](/v2/docs/aws-cdk-lib.aws_appsync.AppsyncFunction)
