# ResolverProps

Additional property for an AppSync resolver for GraphQL API reference.

Extends: ResolverProps
Extends: ExtendedResolverProps
Used as props by: Resolver

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

## Example

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

const pipelineResolver = new appsync.Resolver(this, 'pipeline', {
  api,
  dataSource: api.addNoneDataSource('none'),
  typeName: 'typeName',
  fieldName: 'fieldName',
  requestMappingTemplate: appsync.MappingTemplate.fromFile('beforeRequest.vtl'),
  pipelineConfig: [appsyncFunction],
  responseMappingTemplate: appsync.MappingTemplate.fromFile('afterResponse.vtl'),
});
```

## Properties

- `api`: [IGraphqlApi](/cdk/api/v2/docs/aws-cdk-lib.aws_appsync.IGraphqlApi.html) (required) — The API this resolver is attached to.

- `cachingConfig`: [CachingConfig](/cdk/api/v2/docs/aws-cdk-lib.aws_appsync.CachingConfig.html) — The caching configuration for this resolver.

  **Default:** No caching configuration

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

  **Default:** no code is used

- `dataSource`: [BaseDataSource](/cdk/api/v2/docs/aws-cdk-lib.aws_appsync.BaseDataSource.html) — The data source this resolver is using.

  **Default:** No datasource

- `fieldName`: string (required) — name of the GraphQL field in the given type this resolver is attached to.

- `maxBatchSize`: number — The maximum number of elements per batch, when using batch invoke.

  **Default:** No max batch size

- `metricsConfig`: [ResolverMetricsConfig](/cdk/api/v2/docs/aws-cdk-lib.aws_appsync.ResolverMetricsConfig.html) — Whether to enable enhanced metrics Value will be ignored, if `enhancedMetricsConfig.resolverLevelMetricsBehavior` on AppSync GraphqlApi construct is set to `FULL_REQUEST_RESOLVER_METRICS`.

  **Default:** no metrics configuration

- `pipelineConfig`: [IFunctionConfigurationRef](/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_appsync.IFunctionConfigurationRef.html)[] — configuration of the pipeline resolver.

  **Default:** no pipeline resolver configuration An empty array | undefined sets resolver to be of kind, unit

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

  **Default:** No mapping template

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

  **Default:** No 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

- `typeName`: string (required) — name of the GraphQL type this resolver is attached to.
