Skip to content

Commit

Permalink
chore(appsync): Tidy up README for Merged APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
ndejaco2 committed Oct 25, 2023
1 parent afb3e67 commit 9f7bcb7
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions packages/aws-cdk-lib/aws-appsync/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -377,17 +377,19 @@ const firstApi = new appsync.GraphqlApi(this, 'FirstSourceAPI', {
name: 'FirstSourceAPI',
definition: appsync.Definition.fromFile(path.join(__dirname, 'appsync.merged-api-1.graphql')),
});

firstApi.addNoneDataSource('FirstSourceDS', {
name: cdk.Lazy.string({ produce(): string { return 'FirstSourceDS'; } }),
name: 'FirstSourceDS',
});

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

secondApi.addNoneDataSource('SecondSourceDS', {
name: cdk.Lazy.string({ produce(): string { return 'SecondSourceDS'; } }),
name: 'SecondSourceDS',
});

// Merged API
Expand All @@ -399,6 +401,10 @@ const mergedApi = new appsync.GraphqlApi(this, 'MergedAPI', {
sourceApi: firstApi,
mergeType: appsync.MergeType.MANUAL_MERGE,
},
{
sourceApi: secondApi,
mergeType: appsync.MergeType.AUTO_MERGE,
}
],
}),
});
Expand Down

0 comments on commit 9f7bcb7

Please sign in to comment.