AWS Fundamentals Logo
AWS Fundamentals
L2 Construct

GraphqlApi

An AppSync GraphQL API.

Import

import { GraphqlApi } from 'aws-cdk-lib/aws-appsync';

Or use the module namespace:

import * as appsync from 'aws-cdk-lib/aws-appsync';
// appsync.GraphqlApi

Properties

Configuration passed to the constructor as GraphqlApiProps.

nameRequired
string

the name of the GraphQL API.

authorizationConfigOptional
AuthorizationConfig

Optional authorization configuration.

Default: - API Key authorization

definitionOptional
Definition

Definition (schema file or source APIs) for this GraphQL Api.

domainNameOptional
DomainOptions

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

Default: - no domain name

enhancedMetricsConfigOptional
EnhancedMetricsConfig

Enables and controls the enhanced metrics feature.

Default: - Enhanced metrics disabled.

environmentVariablesOptional
{ [key: string]: string }

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.

Default: - No environment variables.

introspectionConfigOptional
IntrospectionConfig

A value indicating whether the API to enable (ENABLED) or disable (DISABLED) introspection.

Default: IntrospectionConfig.ENABLED

logConfigOptional
LogConfig

Logging configuration for this api.

Default: - None

ownerContactOptional
string

The owner contact information for an API resource. This field accepts any string input with a length of 0 - 256 characters.

Default: - No owner contact.

queryDepthLimitOptional
number

A number indicating the maximum depth resolvers should be accepted when handling queries. Value must be withing range of 0 to 75

Default: - The default value is 0 (or unspecified) which indicates no maximum depth.

resolverCountLimitOptional
number

A number indicating the maximum number of resolvers that should be accepted when handling queries. Value must be withing range of 0 to 10000

Default: - The default value is 0 (or unspecified), which will set the limit to 10000

schemaOptionalDeprecated
ISchema

GraphQL schema definition. Specify how you want to define your schema. SchemaFile.fromAsset(filePath: string) allows schema definition through schema.graphql file

Default: - schema will be generated code-first (i.e. addType, addObjectType, etc.)

Deprecated: use Definition.schema instead

visibilityOptional
Visibility

A value indicating whether the API is accessible from anywhere (GLOBAL) or can only be access from a VPC (PRIVATE).

Default: - GLOBAL

xrayEnabledOptional
boolean

A flag indicating whether or not X-Ray tracing is enabled for the GraphQL API.

Default: - false

Get the AWS AppSync Cheat Sheet

Everything you need to know about AWS AppSync on one page. HD quality, print-friendly.

Download Free Infographic