Last active
October 18, 2021 14:32
-
-
Save mmccall10/c4070e5df1befd95b69e78d98005f099 to your computer and use it in GitHub Desktop.
Revisions
-
mmccall10 revised this gist
Oct 18, 2021 . 1 changed file with 0 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,7 +5,6 @@ export default class GraphqlApiStack extends Stack { super(scope, id, props) this.api = new GraphqlApi(this, 'GraphqlApi', { name: 'GraphqlApi', schema: Schema.fromAsset('graphql/schema.graphql'), authorizationConfig: { -
mmccall10 created this gist
Oct 18, 2021 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,14 @@ import { CfnResolver } from '@aws-cdk/aws-appsync' import { IConstruct } from '@aws-cdk/core' interface IAspect { visit: (node: IConstruct) => void } class EnforceAppSyncResolverNaming implements IAspect { visit (node: IConstruct): void { if (node instanceof CfnResolver) node.overrideLogicalId(`${node.typeName}${node.fieldName}Resolver`) } } export { EnforceAppSyncResolverNaming } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,20 @@ export default class GraphqlApiStack extends Stack { api: GraphqlApi constructor (scope: sst.App, id: string, props: GraphqlStackProps) { super(scope, id, props) this.api = new GraphqlApi(this, 'GraphqlApi', { deltaSyncTable: this.changelogTable, name: 'GraphqlApi', schema: Schema.fromAsset('graphql/schema.graphql'), authorizationConfig: { defaultAuthorization: { authorizationType: AuthorizationType.API_KEY } } }) Aspects.of(this.api).add(new EnforceAppSyncResolverNaming()) } }