How to fix AWS Amplify error: 🛑 Codegen job status is failed No UI components to generate
If you are using amplify push
or amplify pull
and use the AWS AppSync for your managed GraphQL API, you might experience an issue where as AppSync tries to manually import the API schema from the schema.graphql
file, it then will error and say something like the following:
⠸ Generating UI components...🛑 Codegen job status is failed No UI components to generate
What is happening here is that locally, it has pulled the API, but it is not able to compile the queries, mutations, and subscriptions via AWS AppSync.
It might look something like this:
Let’s discuss how to solve this issue…
Solution #1
If the statements have never been generated before, run:
amplify add codegen
This will configure the AppSync GraphQL API queries, mutations, and subscriptions in your designated folder of choice.
In case you need the AppSync API, you can retrieve that in the AppSync dashboard of the AWS Management Console > AppSync > API (yours) - and then look for the AppSync API ID in the configuration settings.
Solution #2
If the statements have been generated before, run:
amplify codegen statements
If you require typescript, also run:
amplify codegen types
This will configure the AppSync GraphQL API queries, mutations, and subscriptions in your designated folder of choice.
🥁 The result…
Here, the GraphQL statements were generated: