From 9f7bcb7f28c46dc2fcb9d95d1d6142f13b5768b6 Mon Sep 17 00:00:00 2001 From: ndejaco2 Date: Wed, 25 Oct 2023 11:11:04 -0700 Subject: [PATCH 1/2] chore(appsync): Tidy up README for Merged APIs --- packages/aws-cdk-lib/aws-appsync/README.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/aws-cdk-lib/aws-appsync/README.md b/packages/aws-cdk-lib/aws-appsync/README.md index ffae1b3f8ac20..aa550e6b067bc 100644 --- a/packages/aws-cdk-lib/aws-appsync/README.md +++ b/packages/aws-cdk-lib/aws-appsync/README.md @@ -377,8 +377,9 @@ 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 @@ -386,8 +387,9 @@ 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 @@ -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, + } ], }), }); From 7b36e231e77a0b32880a5a529675cb6464a1acd5 Mon Sep 17 00:00:00 2001 From: ndejaco2 Date: Wed, 25 Oct 2023 11:29:55 -0700 Subject: [PATCH 2/2] Remove unneccessary datasource creation --- packages/aws-cdk-lib/aws-appsync/README.md | 8 -------- 1 file changed, 8 deletions(-) diff --git a/packages/aws-cdk-lib/aws-appsync/README.md b/packages/aws-cdk-lib/aws-appsync/README.md index aa550e6b067bc..637dbb230edb2 100644 --- a/packages/aws-cdk-lib/aws-appsync/README.md +++ b/packages/aws-cdk-lib/aws-appsync/README.md @@ -378,20 +378,12 @@ const firstApi = new appsync.GraphqlApi(this, 'FirstSourceAPI', { definition: appsync.Definition.fromFile(path.join(__dirname, 'appsync.merged-api-1.graphql')), }); -firstApi.addNoneDataSource('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: 'SecondSourceDS', -}); - // Merged API const mergedApi = new appsync.GraphqlApi(this, 'MergedAPI', { name: 'MergedAPI',