amplify-category-api icon indicating copy to clipboard operation
amplify-category-api copied to clipboard

GraphQL interfaces breaking builds/deploys since 11

Open whunter opened this issue 1 year ago • 12 comments

How did you install the Amplify CLI?

npm

If applicable, what version of Node.js are you using?

20.17.0

Amplify CLI Version

12.13.0

What operating system are you using?

Mac

Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.

updated nodejs runtime in lambda

Describe the bug

Beginning in Amplify 10 (I think) we started seeing this warning on builds because we're using an interface in our schema.graphql. They would not cause builds to fail though. We've had our builds pinned to 10.8.1 which does still support interfaces.

2024-10-14T18:57:36.877Z [WARNING]: ✖ There was an error initializing your environment.
2024-10-14T18:57:36.883Z [INFO]: 🛑 Unknown type GenericRecordType for field items. Did you forget to add the @model directive

Beginning in Amplify 11, this began causing builds to fail.

And we can no longer pin to 10.8.1, because it seemingly tries to build node14 lambdas regardless of what we put in our cloudformation templates. So those break now as well and we can't build our app at all.

Expected behavior

Amplify build/deploy shouldn't require that all GraphQL return types have @model. That isn't always the case. (interfaces | unions)

Reproduction steps

  1. Deploy an Amplify app with an interface in the schema.graphql
  2. Receive warning/error message

Project Identifier

Amplify app id: d2ysrrdhih4bgc

Log output

# Put your logs below this line

2024-10-14T18:57:36.877Z [WARNING]: ✖ There was an error initializing your environment.
2024-10-14T18:57:36.883Z [INFO]: 🛑 Unknown type GenericRecordType for field items. Did you forget to add the @model directive

Additional information

No response

Before submitting, please confirm:

  • [X] I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
  • [X] I have removed any sensitive information from my code snippets and submission.

whunter avatar Oct 14 '24 21:10 whunter