# GraphqlApiAttributes

Attributes for GraphQL imports.

- 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#L533)
- Type last changed: v2.142.0 · 16 May 2024

## Example

```ts
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

- `graphqlApiArn`: string — the arn for the GraphQL Api.

  **Default:** autogenerated arn

- `graphqlApiId`: string (required) — a unique AWS AppSync GraphQL API identifier i.e. 'lxz775lwdrgcndgz3nurvac7oa'.

- `graphQLEndpointArn`: string — The GraphQl endpoint arn for the GraphQL API.

  **Default:** none, required to construct event rules from imported APIs

- `modes`: [AuthorizationType](/cdk/api/v2/docs/aws-cdk-lib.aws_appsync.AuthorizationType.html)[] — The Authorization Types for this GraphQL Api.

  **Default:** none, required to construct event rules from imported APIs

- `visibility`: [Visibility](/cdk/api/v2/docs/aws-cdk-lib.aws_appsync.Visibility.html) = GLOBAL — The GraphQl API visibility.
