GraphqlApiProps

class aws_cdk.aws_appsync.GraphqlApiProps(*, name, authorization_config=None, definition=None, domain_name=None, environment_variables=None, introspection_config=None, log_config=None, query_depth_limit=None, resolver_count_limit=None, schema=None, visibility=None, xray_enabled=None)

Bases: object

Properties for an AppSync GraphQL API.

Parameters:
  • name (str) – the name of the GraphQL API.

  • authorization_config (Union[AuthorizationConfig, Dict[str, Any], None]) – Optional authorization configuration. Default: - API Key authorization

  • definition (Optional[Definition]) – Definition (schema file or source APIs) for this GraphQL Api.

  • domain_name (Union[DomainOptions, Dict[str, Any], None]) – 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

  • environment_variables (Optional[Mapping[str, str]]) – 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.

  • introspection_config (Optional[IntrospectionConfig]) – A value indicating whether the API to enable (ENABLED) or disable (DISABLED) introspection. Default: IntrospectionConfig.ENABLED

  • log_config (Union[LogConfig, Dict[str, Any], None]) – Logging configuration for this api. Default: - None

  • query_depth_limit (Union[int, float, None]) – 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.

  • resolver_count_limit (Union[int, float, None]) – 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

  • schema (Optional[ISchema]) – (deprecated) 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.)

  • visibility (Optional[Visibility]) – A value indicating whether the API is accessible from anywhere (GLOBAL) or can only be access from a VPC (PRIVATE). Default: - GLOBAL

  • xray_enabled (Optional[bool]) – A flag indicating whether or not X-Ray tracing is enabled for the GraphQL API. Default: - false

ExampleMetadata:

infused

Example:

source_api = appsync.GraphqlApi(self, "FirstSourceAPI",
    name="FirstSourceAPI",
    definition=appsync.Definition.from_file(path.join(__dirname, "appsync.merged-api-1.graphql"))
)

imported_merged_api = appsync.GraphqlApi.from_graphql_api_attributes(self, "ImportedMergedApi",
    graphql_api_id="MyApiId",
    graphql_api_arn="MyApiArn"
)

imported_execution_role = iam.Role.from_role_arn(self, "ExecutionRole", "arn:aws:iam::ACCOUNT:role/MyExistingRole")
appsync.SourceApiAssociation(self, "SourceApiAssociation2",
    source_api=source_api,
    merged_api=imported_merged_api,
    merge_type=appsync.MergeType.MANUAL_MERGE,
    merged_api_execution_role=imported_execution_role
)

Attributes

authorization_config

Optional authorization configuration.

Default:
  • API Key authorization

definition

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

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

Default:
  • no domain name

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.

Default:
  • No environment variables.

introspection_config

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

Default:

IntrospectionConfig.ENABLED

log_config

Logging configuration for this api.

Default:
  • None

name

the name of the GraphQL API.

query_depth_limit

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.

resolver_count_limit

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

schema

(deprecated) 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

Stability:

deprecated

visibility

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

Default:
  • GLOBAL

xray_enabled

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

Default:
  • false