# SchemaProps

The options for configuring a schema from an existing file.

Extends: SchemaProps
Used as props by: SchemaFile

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

## 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

- `filePath`: string (required) — The file path for the schema.

  When this option is
  configured, then the schema will be generated from an
  existing file from disk.
