# ExtendedResolverProps

Additional property for an AppSync resolver for data source reference.

Extends: [BaseResolverProps](/cdk/api/v2/docs/aws-cdk-lib.aws_appsync.BaseResolverProps.html)

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

## Example

TypeScript:

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

declare const baseDataSource: appsync.BaseDataSource;
declare const code: appsync.Code;
declare const functionConfigurationRef: interfaces_appsync.IFunctionConfigurationRef;
declare const functionRuntime: appsync.FunctionRuntime;
declare const mappingTemplate: appsync.MappingTemplate;
const extendedResolverProps: appsync.ExtendedResolverProps = {
  fieldName: 'fieldName',
  typeName: 'typeName',

  // the properties below are optional
  cachingConfig: {
    ttl: cdk.Duration.minutes(30),

    // the properties below are optional
    cachingKeys: ['cachingKeys'],
  },
  code: code,
  dataSource: baseDataSource,
  maxBatchSize: 123,
  metricsConfig: appsync.ResolverMetricsConfig.ENABLED,
  pipelineConfig: [functionConfigurationRef],
  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.
import aws_cdk as cdk
from aws_cdk import aws_appsync as appsync
from aws_cdk.interfaces import aws_appsync as interfaces_appsync

# base_data_source: appsync.BaseDataSource
# code: appsync.Code
# function_configuration_ref: interfaces_appsync.IFunctionConfigurationRef
# function_runtime: appsync.FunctionRuntime
# mapping_template: appsync.MappingTemplate

extended_resolver_props = appsync.ExtendedResolverProps(
    field_name="fieldName",
    type_name="typeName",

    # the properties below are optional
    caching_config=appsync.CachingConfig(
        ttl=cdk.Duration.minutes(30),

        # the properties below are optional
        caching_keys=["cachingKeys"]
    ),
    code=code,
    data_source=base_data_source,
    max_batch_size=123,
    metrics_config=appsync.ResolverMetricsConfig.ENABLED,
    pipeline_config=[function_configuration_ref],
    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.*;
import software.amazon.awscdk.services.appsync.*;
import software.amazon.awscdk.interfaces.appsync.*;

BaseDataSource baseDataSource;
Code code;
IFunctionConfigurationRef functionConfigurationRef;
FunctionRuntime functionRuntime;
MappingTemplate mappingTemplate;

ExtendedResolverProps extendedResolverProps = ExtendedResolverProps.builder()
        .fieldName("fieldName")
        .typeName("typeName")

        // the properties below are optional
        .cachingConfig(CachingConfig.builder()
                .ttl(Duration.minutes(30))

                // the properties below are optional
                .cachingKeys(List.of("cachingKeys"))
                .build())
        .code(code)
        .dataSource(baseDataSource)
        .maxBatchSize(123)
        .metricsConfig(ResolverMetricsConfig.ENABLED)
        .pipelineConfig(List.of(functionConfigurationRef))
        .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;
using Amazon.CDK.AWS.AppSync;
using Amazon.CDK.Interfaces.AppSync;

BaseDataSource baseDataSource;
Code code;
IFunctionConfigurationRef functionConfigurationRef;
FunctionRuntime functionRuntime;
MappingTemplate mappingTemplate;

var extendedResolverProps = new ExtendedResolverProps {
    FieldName = "fieldName",
    TypeName = "typeName",

    // the properties below are optional
    CachingConfig = new CachingConfig {
        Ttl = Duration.Minutes(30),

        // the properties below are optional
        CachingKeys = new [] { "cachingKeys" }
    },
    Code = code,
    DataSource = baseDataSource,
    MaxBatchSize = 123,
    MetricsConfig = ResolverMetricsConfig.ENABLED,
    PipelineConfig = new [] { functionConfigurationRef },
    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 cdk "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"

var baseDataSource BaseDataSource
var code Code
var functionConfigurationRef IFunctionConfigurationRef
var functionRuntime FunctionRuntime
var mappingTemplate MappingTemplate

extendedResolverProps := &ExtendedResolverProps{
	FieldName: jsii.String("fieldName"),
	TypeName: jsii.String("typeName"),

	// the properties below are optional
	CachingConfig: &CachingConfig{
		Ttl: cdk.Duration_Minutes(jsii.Number(30)),

		// the properties below are optional
		CachingKeys: []*string{
			jsii.String("cachingKeys"),
		},
	},
	Code: code,
	DataSource: baseDataSource,
	MaxBatchSize: jsii.Number(123),
	MetricsConfig: awscdk.Aws_appsync.ResolverMetricsConfig_ENABLED,
	PipelineConfig: []IFunctionConfigurationRef{
		functionConfigurationRef,
	},
	RequestMappingTemplate: mappingTemplate,
	ResponseMappingTemplate: mappingTemplate,
	Runtime: functionRuntime,
}
```

## Properties

- `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.
