From bf0e7499749f26135a4291ade199d51bc073589c Mon Sep 17 00:00:00 2001 From: Ian Saultz <52051793+atierian@users.noreply.github.com> Date: Tue, 3 Sep 2024 13:54:41 -0400 Subject: [PATCH] revert auth change --- .../src/graphql-auth-transformer.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/amplify-graphql-auth-transformer/src/graphql-auth-transformer.ts b/packages/amplify-graphql-auth-transformer/src/graphql-auth-transformer.ts index c269b8a9ff..24111be950 100644 --- a/packages/amplify-graphql-auth-transformer/src/graphql-auth-transformer.ts +++ b/packages/amplify-graphql-auth-transformer/src/graphql-auth-transformer.ts @@ -1532,7 +1532,7 @@ export class AuthTransformer extends TransformerAuthBase implements TransformerA allowedFields: Set, fields: readonly string[], ): void => { - const typeDefinitions = ctx.output.getTypeDefinitionsOfKind('ObjectTypeDefinition') as ObjectTypeDefinitionNode[]; + const typeDefinitions = ctx.inputDocument.definitions.filter((it) => it.kind === 'ObjectTypeDefinition') as ObjectTypeDefinitionNode[]; this.addAutoGeneratedHasManyFields(ctx, typeDefinitions, def, allowedFields); this.addAutoGeneratedHasOneFields(ctx, typeDefinitions, fields, def, allowedFields);