# GraphqlApiProps

Properties for an AppSync GraphQL API.

Extends: GraphqlApiProps
Used as props by: GraphqlApi

- Source: [`aws-appsync/lib/graphqlapi.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-appsync/lib/graphqlapi.ts#L418)
- Type last changed: v2.242.0 · 10 Mar 2026

## Example

```ts
const schema = new appsync.SchemaFile({ filePath: 'mySchemaFile' })
new appsync.GraphqlApi(this, 'api', {
  name: 'myApi',
  definition: appsync.Definition.fromSchema(schema),
  enhancedMetricsConfig: {
    dataSourceLevelMetricsBehavior: appsync.DataSourceLevelMetricsBehavior.FULL_REQUEST_DATA_SOURCE_METRICS,
    operationLevelMetricsConfig: appsync.OperationLevelMetricsConfig.ENABLED,
    resolverLevelMetricsBehavior: appsync.ResolverLevelMetricsBehavior.FULL_REQUEST_RESOLVER_METRICS,
  },
});
```

## Properties

- `authorizationConfig`: [AuthorizationConfig](/cdk/api/v2/docs/aws-cdk-lib.aws_appsync.AuthorizationConfig.html) — Optional authorization configuration.

  **Default:** API Key authorization

- `definition`: [Definition](/cdk/api/v2/docs/aws-cdk-lib.aws_appsync.Definition.html) — Definition (schema file or source APIs) for this GraphQL Api.

- `domainName`: [DomainOptions](/cdk/api/v2/docs/aws-cdk-lib.aws_appsync.DomainOptions.html) — The domain name configuration for the GraphQL API.

  **Default:** no domain name

  The Route 53 hosted zone and CName DNS record must be configured in addition to this setting to
  enable custom domain URL

- `enhancedMetricsConfig`: [EnhancedMetricsConfig](/cdk/api/v2/docs/aws-cdk-lib.aws_appsync.EnhancedMetricsConfig.html) — Enables and controls the enhanced metrics feature.

  **Default:** Enhanced metrics disabled.

- `environmentVariables`: { [key: string]: string } — A map containing the list of resources with their properties and environment variables.

  **Default:** No 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`: [IntrospectionConfig](/cdk/api/v2/docs/aws-cdk-lib.aws_appsync.IntrospectionConfig.html) = IntrospectionConfig.ENABLED — A value indicating whether the API to enable (ENABLED) or disable (DISABLED) introspection.

- `logConfig`: [LogConfig](/cdk/api/v2/docs/aws-cdk-lib.aws_appsync.LogConfig.html) = None — Logging configuration for this api.

- `name`: string (required) — the name of the GraphQL API.

- `ownerContact`: string — The owner contact information for an API resource.

  **Default:** No owner contact.

  This field accepts any string input with a length of 0 - 256 characters.

- `queryDepthLimit`: number — A number indicating the maximum depth resolvers should be accepted when handling queries.

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

  Value must be withing range of 0 to 75

- `resolverCountLimit`: number — A number indicating the maximum number of resolvers that should be accepted when handling queries.

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

  Value must be withing range of 0 to 10000

- `schema`: [ISchema](/cdk/api/v2/docs/aws-cdk-lib.aws_appsync.ISchema.html) — use Definition.schema instead

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

  SchemaFile.fromAsset(filePath: string) allows schema definition through schema.graphql file

- `visibility`: [Visibility](/cdk/api/v2/docs/aws-cdk-lib.aws_appsync.Visibility.html) = GLOBAL — A value indicating whether the API is accessible from anywhere (GLOBAL) or can only be access from a VPC (PRIVATE).

- `xrayEnabled`: boolean = false — A flag indicating whether or not X-Ray tracing is enabled for the GraphQL API.
