You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add support for [AppSync Merged API](https://aws.amazon.com/blogs/mobile/introducing-merged-apis-on-aws-appsync/) feature.
At the moment, a GraphQL schema can be passed using the `schema` property. I deprecated this property because it is not used for merged APIs.
Depecreated syntax:
```ts
const api = new appsync.GraphqlApi(this, 'Api', {
name: 'demo',
schema: appsync.SchemaFile.fromAsset(path.join(__dirname, 'schema.graphql')),
});
```
Instead, I introduced a new property `apiSource` that can be used to create a AppSync GraphQL API or Merged API.
GraphQL API:
```ts
const api = new appsync.GraphqlApi(this, 'Api', {
name: 'demo',
apiSource: appsync.ApiSource.fromSchema(appsync.SchemaFile.fromAsset(path.join(__dirname, 'schema.graphql'))),
// short version
apiSource: appsync.ApiSource.fromFile(path.join(__dirname, 'schema.graphql')),
});
```
Merged API:
```ts
const api = new appsync.GraphqlApi(this, 'Api', {
name: 'demo',
apiSource: appsync.ApiSource.fromSourceApis({
sourceApis: [
{
sourceApi: firstApi,
mergeType: appsync.MergeType.MANUAL_MERGE,
},
{
sourceApi: secondApi,
mergeType: appsync.MergeType.AUTO_MERGE,
},
],
}),
});
```
Closes#25960.
----
*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
0 commit comments