# SourceApiOptions

Additional API configuration for creating a AppSync Merged API.

- Source: [`aws-appsync/lib/graphqlapi.ts`](https://github.com/aws/aws-cdk/blob/v2.277.0/packages/aws-cdk-lib/aws-appsync/lib/graphqlapi.ts#L331)
- Type last changed: v2.94.0 · 1 Sep 2023

## Example

```ts
import * as cdk from 'aws-cdk-lib';

// first source API
const firstApi = new appsync.GraphqlApi(this, 'FirstSourceAPI', {
  name: 'FirstSourceAPI',
  definition: appsync.Definition.fromFile(path.join(__dirname, 'appsync.merged-api-1.graphql')),
});

// second source API
const secondApi = new appsync.GraphqlApi(this, 'SecondSourceAPI', {
  name: 'SecondSourceAPI',
  definition: appsync.Definition.fromFile(path.join(__dirname, 'appsync.merged-api-2.graphql')),
});

// Merged API
const mergedApi = new appsync.GraphqlApi(this, 'MergedAPI', {
  name: 'MergedAPI',
  definition: appsync.Definition.fromSourceApis({
    sourceApis: [
      {
        sourceApi: firstApi,
        mergeType: appsync.MergeType.MANUAL_MERGE,
      },
      {
        sourceApi: secondApi,
        mergeType: appsync.MergeType.AUTO_MERGE,
      }
    ],
  }),
});
```

## Properties

- `mergedApiExecutionRole`: [Role](/cdk/api/v2/docs/aws-cdk-lib.aws_iam.Role.html) — IAM Role used to validate access to source APIs at runtime and to update the merged API endpoint with the source API changes.

  **Default:** An IAM Role with acccess to source schemas will be created

- `sourceApis`: [SourceApi](/cdk/api/v2/docs/aws-cdk-lib.aws_appsync.SourceApi.html)[] (required) — Definition of source APIs associated with this Merged API.
