SchemaFile
- class aws_cdk.aws_appsync.SchemaFile(*, file_path)
Bases:
objectThe Schema for a GraphQL Api.
If no options are configured, schema will be generated code-first.
- ExampleMetadata:
infused
Example:
schema = appsync.SchemaFile(file_path="mySchemaFile") appsync.GraphqlApi(self, "api", name="myApi", definition=appsync.Definition.from_schema(schema), enhanced_metrics_config=appsync.EnhancedMetricsConfig( data_source_level_metrics_behavior=appsync.DataSourceLevelMetricsBehavior.FULL_REQUEST_DATA_SOURCE_METRICS, operation_level_metrics_config=appsync.OperationLevelMetricsConfig.ENABLED, resolver_level_metrics_behavior=appsync.ResolverLevelMetricsBehavior.FULL_REQUEST_RESOLVER_METRICS ) )
- Parameters:
file_path (
str) – The file path for the schema. When this option is configured, then the schema will be generated from an existing file from disk.
Methods
- bind(api)
Called when the GraphQL Api is initialized to allow this object to bind to the stack.
- Parameters:
api (
IGraphQLApiRef) – The binding GraphQL Api.- Return type:
Attributes
- definition
The definition for this schema.
Static Methods
- classmethod from_asset(file_path)
Generate a Schema from file.
- Parameters:
file_path (
str) – the file path of the schema file.- Return type:
- Returns:
SchemaAssetwith immutable schema defintion