interface GraphqlApiProps
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.AppSync.GraphqlApiProps |
![]() | software.amazon.awscdk.services.appsync.GraphqlApiProps |
![]() | aws_cdk.aws_appsync.GraphqlApiProps |
![]() | @aws-cdk/aws-appsync » GraphqlApiProps |
Properties for an AppSync GraphQL API.
Example
const api = new appsync.GraphqlApi(this, 'Api', {
name: 'demo',
});
const demo = new appsync.ObjectType('Demo', {
definition: {
id: appsync.GraphqlType.string({ isRequired: true }),
version: appsync.GraphqlType.string({ isRequired: true }),
},
});
api.addType(demo);
Properties
Name | Type | Description |
---|---|---|
name | string | the name of the GraphQL API. |
authorization | Authorization | Optional authorization configuration. |
domain | Domain | The domain name configuration for the GraphQL API. |
log | Log | Logging configuration for this api. |
schema? | Schema | GraphQL schema definition. Specify how you want to define your schema. |
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.
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.
schema?
Type:
Schema
(optional, default: schema will be generated code-first (i.e. addType, addObjectType, etc.))
GraphQL schema definition. Specify how you want to define your schema.
Schema.fromFile(filePath: string) allows schema definition through schema.graphql file
xrayEnabled?
Type:
boolean
(optional, default: false)
A flag indicating whether or not X-Ray tracing is enabled for the GraphQL API.