Class SchemaFile
java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.appsync.SchemaFile
- All Implemented Interfaces:
ISchema
,software.amazon.jsii.JsiiSerializable
@Generated(value="jsii-pacmak/1.104.0 (build e79254c)",
date="2024-11-21T06:34:03.628Z")
@Stability(Stable)
public class SchemaFile
extends software.amazon.jsii.JsiiObject
implements ISchema
The Schema for a GraphQL Api.
If no options are configured, schema will be generated code-first.
Example:
import software.amazon.awscdk.services.certificatemanager.*; import software.amazon.awscdk.services.route53.*; // hosted zone and route53 features String hostedZoneId; String zoneName = "example.com"; String myDomainName = "api.example.com"; Certificate certificate = Certificate.Builder.create(this, "cert").domainName(myDomainName).build(); SchemaFile schema = SchemaFile.Builder.create().filePath("mySchemaFile").build(); GraphqlApi api = GraphqlApi.Builder.create(this, "api") .name("myApi") .definition(Definition.fromSchema(schema)) .domainName(DomainOptions.builder() .certificate(certificate) .domainName(myDomainName) .build()) .build(); // hosted zone for adding appsync domain IHostedZone zone = HostedZone.fromHostedZoneAttributes(this, "HostedZone", HostedZoneAttributes.builder() .hostedZoneId(hostedZoneId) .zoneName(zoneName) .build()); // create a cname to the appsync domain. will map to something like xxxx.cloudfront.net // create a cname to the appsync domain. will map to something like xxxx.cloudfront.net CnameRecord.Builder.create(this, "CnameApiRecord") .recordName("api") .zone(zone) .domainName(api.getAppSyncDomainName()) .build();
-
Nested Class Summary
Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
Nested classes/interfaces inherited from interface software.amazon.awscdk.services.appsync.ISchema
ISchema.Jsii$Default, ISchema.Jsii$Proxy
-
Constructor Summary
ModifierConstructorDescriptionSchemaFile
(SchemaProps options) protected
SchemaFile
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
SchemaFile
(software.amazon.jsii.JsiiObjectRef objRef) -
Method Summary
Modifier and TypeMethodDescriptionbind
(IGraphqlApi api) Called when the GraphQL Api is initialized to allow this object to bind to the stack.bind
(IGraphqlApi api, SchemaBindOptions _options) Called when the GraphQL Api is initialized to allow this object to bind to the stack.static SchemaFile
Generate a Schema from file.The definition for this schema.void
setDefinition
(String value) The definition for this schema.Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Constructor Details
-
SchemaFile
protected SchemaFile(software.amazon.jsii.JsiiObjectRef objRef) -
SchemaFile
protected SchemaFile(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
SchemaFile
- Parameters:
options
- This parameter is required.
-
-
Method Details
-
fromAsset
Generate a Schema from file.- Parameters:
filePath
- the file path of the schema file. This parameter is required.- Returns:
SchemaAsset
with immutable schema defintion
-
bind
@Stability(Stable) @NotNull public ISchemaConfig bind(@NotNull IGraphqlApi api, @Nullable SchemaBindOptions _options) Called when the GraphQL Api is initialized to allow this object to bind to the stack. -
bind
Called when the GraphQL Api is initialized to allow this object to bind to the stack. -
getDefinition
The definition for this schema. -
setDefinition
The definition for this schema.
-