Class SchemaProps
The options for configuring a schema from an existing file.
Implements
Inherited Members
Namespace: Amazon.CDK.AWS.AppSync
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class SchemaProps : ISchemaProps
Syntax (vb)
Public Class SchemaProps Implements ISchemaProps
Remarks
ExampleMetadata: infused
Examples
var schema = new SchemaFile(new SchemaProps { FilePath = "mySchemaFile" });
var api = new GraphqlApi(this, "api", new GraphqlApiProps {
Name = "myApi",
Definition = Definition.FromSchema(schema),
EnhancedMetricsConfig = new EnhancedMetricsConfig {
DataSourceLevelMetricsBehavior = DataSourceLevelMetricsBehavior.PER_DATA_SOURCE_METRICS,
OperationLevelMetricsConfig = OperationLevelMetricsConfig.ENABLED,
ResolverLevelMetricsBehavior = ResolverLevelMetricsBehavior.PER_RESOLVER_METRICS
}
});
var noneDS = api.AddNoneDataSource("none", new DataSourceOptions {
MetricsConfig = DataSourceMetricsConfig.ENABLED
});
noneDS.CreateResolver("noneResolver", new BaseResolverProps {
TypeName = "Mutation",
FieldName = "addDemoMetricsConfig",
MetricsConfig = ResolverMetricsConfig.ENABLED
});
Synopsis
Constructors
| SchemaProps() | The options for configuring a schema from an existing file. |
Properties
| FilePath | The file path for the schema. |
Constructors
SchemaProps()
The options for configuring a schema from an existing file.
public SchemaProps()
Remarks
ExampleMetadata: infused
Examples
var schema = new SchemaFile(new SchemaProps { FilePath = "mySchemaFile" });
var api = new GraphqlApi(this, "api", new GraphqlApiProps {
Name = "myApi",
Definition = Definition.FromSchema(schema),
EnhancedMetricsConfig = new EnhancedMetricsConfig {
DataSourceLevelMetricsBehavior = DataSourceLevelMetricsBehavior.PER_DATA_SOURCE_METRICS,
OperationLevelMetricsConfig = OperationLevelMetricsConfig.ENABLED,
ResolverLevelMetricsBehavior = ResolverLevelMetricsBehavior.PER_RESOLVER_METRICS
}
});
var noneDS = api.AddNoneDataSource("none", new DataSourceOptions {
MetricsConfig = DataSourceMetricsConfig.ENABLED
});
noneDS.CreateResolver("noneResolver", new BaseResolverProps {
TypeName = "Mutation",
FieldName = "addDemoMetricsConfig",
MetricsConfig = ResolverMetricsConfig.ENABLED
});
Properties
FilePath
The file path for the schema.
public string FilePath { get; set; }
Property Value
Remarks
When this option is configured, then the schema will be generated from an existing file from disk.