interface GraphqlApiProps
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.AppSync.GraphqlApiProps |
![]() | github.com/aws/aws-cdk-go/awscdk/v2/awsappsync#GraphqlApiProps |
![]() | software.amazon.awscdk.services.appsync.GraphqlApiProps |
![]() | aws_cdk.aws_appsync.GraphqlApiProps |
![]() | aws-cdk-lib » aws_appsync » GraphqlApiProps |
Properties for an AppSync GraphQL API.
Example
const api = new appsync.GraphqlApi(stack, 'EventBridgeApi', {
name: 'EventBridgeApi',
schema: appsync.SchemaFile.fromAsset(path.join(__dirname, 'appsync.eventbridge.graphql')),
});
const bus = new events.EventBus(stack, 'DestinationEventBus', {});
const dataSource = api.addEventBridgeDataSource('NoneDS', bus);
dataSource.createResolver('EventResolver', {
typeName: 'Mutation',
fieldName: 'emitEvent',
requestMappingTemplate: appsync.MappingTemplate.fromFile('request.vtl'),
responseMappingTemplate: appsync.MappingTemplate.fromFile('response.vtl'),
});
Properties
Name | Type | Description |
---|---|---|
name | string | the name of the GraphQL API. |
schema | ISchema | GraphQL schema definition. Specify how you want to define your schema. |
authorization | Authorization | Optional authorization configuration. |
domain | Domain | The domain name configuration for the GraphQL API. |
log | Log | Logging configuration for this api. |
visibility? | Visibility | A value indicating whether the API is accessible from anywhere (GLOBAL) or can only be access from a VPC (PRIVATE). |
xray | boolean | A flag indicating whether or not X-Ray tracing is enabled for the GraphQL API. |
name
Type:
string
the name of the GraphQL API.
schema
Type:
ISchema
GraphQL schema definition. Specify how you want to define your schema.
Schema.fromFile(filePath: string) allows schema definition through schema.graphql file
authorizationConfig?
Type:
Authorization
(optional, default: API Key authorization)
Optional authorization configuration.
domainName?
Type:
Domain
(optional, default: no domain name)
The domain name configuration for the GraphQL API.
The Route 53 hosted zone and CName DNS record must be configured in addition to this setting to enable custom domain URL
logConfig?
Type:
Log
(optional, default: None)
Logging configuration for this api.
visibility?
Type:
Visibility
(optional, default: GLOBAL)
A value indicating whether the API is accessible from anywhere (GLOBAL) or can only be access from a VPC (PRIVATE).
xrayEnabled?
Type:
boolean
(optional, default: false)
A flag indicating whether or not X-Ray tracing is enabled for the GraphQL API.