Interface DataSourceOptions
- All Superinterfaces:
software.amazon.jsii.JsiiSerializable
- All Known Subinterfaces:
HttpDataSourceOptions
- All Known Implementing Classes:
DataSourceOptions.Jsii$Proxy,HttpDataSourceOptions.Jsii$Proxy
@Generated(value="jsii-pacmak/1.127.0 (build 2117ad5)",
date="2026-03-19T12:54:58.966Z")
@Stability(Stable)
public interface DataSourceOptions
extends software.amazon.jsii.JsiiSerializable
Optional configuration for data sources.
Example:
SchemaFile schema = SchemaFile.Builder.create().filePath("mySchemaFile").build();
GraphqlApi api = GraphqlApi.Builder.create(this, "api")
.name("myApi")
.definition(Definition.fromSchema(schema))
.enhancedMetricsConfig(EnhancedMetricsConfig.builder()
.dataSourceLevelMetricsBehavior(DataSourceLevelMetricsBehavior.PER_DATA_SOURCE_METRICS)
.operationLevelMetricsConfig(OperationLevelMetricsConfig.ENABLED)
.resolverLevelMetricsBehavior(ResolverLevelMetricsBehavior.PER_RESOLVER_METRICS)
.build())
.build();
NoneDataSource noneDS = api.addNoneDataSource("none", DataSourceOptions.builder()
.metricsConfig(DataSourceMetricsConfig.ENABLED)
.build());
noneDS.createResolver("noneResolver", BaseResolverProps.builder()
.typeName("Mutation")
.fieldName("addDemoMetricsConfig")
.metricsConfig(ResolverMetricsConfig.ENABLED)
.build());
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classA builder forDataSourceOptionsstatic final classAn implementation forDataSourceOptions -
Method Summary
Modifier and TypeMethodDescriptionstatic DataSourceOptions.Builderbuilder()default StringThe description of the data source.default DataSourceMetricsConfigWhether to enable enhanced metrics of the data source Value will be ignored, ifenhancedMetricsConfig.dataSourceLevelMetricsBehavioron AppSync GraphqlApi construct is set toFULL_REQUEST_DATA_SOURCE_METRICS.default StringgetName()The name of the data source, overrides the id given by cdk.Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Method Details
-
getDescription
The description of the data source.Default: - No description
-
getMetricsConfig
Whether to enable enhanced metrics of the data source Value will be ignored, ifenhancedMetricsConfig.dataSourceLevelMetricsBehavioron AppSync GraphqlApi construct is set toFULL_REQUEST_DATA_SOURCE_METRICS.Default: - Enhance metrics are disabled
-
getName
The name of the data source, overrides the id given by cdk.Default: - generated by cdk given the id
-
builder
- Returns:
- a
DataSourceOptions.BuilderofDataSourceOptions
-