SchemaProps Struct
The options for configuring a schema from an existing file.
Example
ts
const schema = new appsync.SchemaFile({ filePath: 'mySchemaFile' })
const api = new appsync.GraphqlApi(this, 'api', {
name: 'myApi',
definition: appsync.Definition.fromSchema(schema),
enhancedMetricsConfig: {
dataSourceLevelMetricsBehavior: appsync.DataSourceLevelMetricsBehavior.PER_DATA_SOURCE_METRICS,
operationLevelMetricsConfig: appsync.OperationLevelMetricsConfig.ENABLED,
resolverLevelMetricsBehavior: appsync.ResolverLevelMetricsBehavior.PER_RESOLVER_METRICS,
},
});
const noneDS = api.addNoneDataSource('none', {
metricsConfig: appsync.DataSourceMetricsConfig.ENABLED,
});
noneDS.createResolver('noneResolver', {
typeName: 'Mutation',
fieldName: 'addDemoMetricsConfig',
metricsConfig: appsync.ResolverMetricsConfig.ENABLED,
});
Properties
The file path for the schema.
When this option is configured, then the schema will be generated from an existing file from disk.