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 sourceApi = new appsync.GraphqlApi(this, 'FirstSourceAPI', {
name: 'FirstSourceAPI',
definition: appsync.Definition.fromFile(path.join(__dirname, 'appsync.merged-api-1.graphql')),
});
const importedMergedApi = appsync.GraphqlApi.fromGraphqlApiAttributes(this, 'ImportedMergedApi', {
graphqlApiId: 'MyApiId',
graphqlApiArn: 'MyApiArn',
});
const importedExecutionRole = iam.Role.fromRoleArn(this, 'ExecutionRole', 'arn:aws:iam::ACCOUNT:role/MyExistingRole');
new appsync.SourceApiAssociation(this, 'SourceApiAssociation2', {
sourceApi: sourceApi,
mergedApi: importedMergedApi,
mergeType: appsync.MergeType.MANUAL_MERGE,
mergedApiExecutionRole: importedExecutionRole,
});
Properties
Name | Type | Description |
---|---|---|
name | string | the name of the GraphQL API. |
authorization | Authorization | Optional authorization configuration. |
definition? | Definition | Definition (schema file or source APIs) for this GraphQL Api. |
domain | Domain | The domain name configuration for the GraphQL API. |
environment | { [string]: string } | A map containing the list of resources with their properties and environment variables. |
introspection | Introspection | A value indicating whether the API to enable (ENABLED) or disable (DISABLED) introspection. |
log | Log | Logging configuration for this api. |
owner | string | The owner contact information for an API resource. |
query | number | A number indicating the maximum depth resolvers should be accepted when handling queries. |
resolver | number | A number indicating the maximum number of resolvers that should be accepted when handling queries. |
schema? | ISchema | GraphQL schema definition. Specify how you want to define your schema. |
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.
authorizationConfig?
Type:
Authorization
(optional, default: API Key authorization)
Optional authorization configuration.
definition?
Type:
Definition
(optional)
Definition (schema file or source APIs) for this GraphQL Api.
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
environmentVariables?
Type:
{ [string]: string }
(optional, default: No environment variables.)
A map containing the list of resources with their properties and environment variables.
There are a few rules you must follow when creating keys and values:
- Keys must begin with a letter.
- Keys must be between 2 and 64 characters long.
- Keys can only contain letters, numbers, and the underscore character (_).
- Values can be up to 512 characters long.
- You can configure up to 50 key-value pairs in a GraphQL API.
introspectionConfig?
Type:
Introspection
(optional, default: IntrospectionConfig.ENABLED)
A value indicating whether the API to enable (ENABLED) or disable (DISABLED) introspection.
logConfig?
Type:
Log
(optional, default: None)
Logging configuration for this api.
ownerContact?
Type:
string
(optional, default: No owner contact.)
The owner contact information for an API resource.
This field accepts any string input with a length of 0 - 256 characters.
queryDepthLimit?
Type:
number
(optional, default: The default value is 0 (or unspecified) which indicates no maximum depth.)
A number indicating the maximum depth resolvers should be accepted when handling queries.
Value must be withing range of 0 to 75
resolverCountLimit?
Type:
number
(optional, default: The default value is 0 (or unspecified), which will set the limit to 10000)
A number indicating the maximum number of resolvers that should be accepted when handling queries.
Value must be withing range of 0 to 10000
schema?
⚠️ Deprecated: use Definition.schema instead
Type:
ISchema
(optional, default: schema will be generated code-first (i.e. addType, addObjectType, etc.))
GraphQL schema definition. Specify how you want to define your schema.
SchemaFile.fromAsset(filePath: string) allows schema definition through schema.graphql file
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.