aws-amplify / aws-amplify/amplify-codegen

amplify codegen generates empty API.ts and non-typescript operation files in github actions workflow

Open
#436 9 comments 0 reactions 0 assignees View on GitHub
bug p2 transferred
Dominant language
TypeScript
Stars
59
Forks
64
PR merge metrics
No merged PRs in 30d

Description

### Before opening, please confirm:

- [X] I have installed the latest version of the Amplify CLI (see above), and confirmed that the issue still persists.
- [X] I have [searched for duplicate or closed issues](https://github.com/aws-amplify/amplify-cli/issues?q=is%3Aissue+).
- [X] I have read the guide for [submitting bug reports](https://github.com/aws-amplify/amplify-cli/blob/master/CONTRIBUTING.md#bug-reports).
- [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.

### How did you install the Amplify CLI?

yarn global add @aws-amplify/cli

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

14.17.4

### Amplify CLI Version

8.3.0

### What operating system are you using?

Windows

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

No manual changes made

### Amplify Categories

Not applicable

### Amplify Commands

codegen

### Describe the bug

Running amplify codegen on my local machine works fine, `API.ts` is generated non-empty and `mutations.ts`, `queries.ts`, `subscriptions.ts` are generated as well.

However, when running on Github Actions workflow, the `API.ts` generated is empty and the files generated are in graphql format.
![image](https://user-images.githubusercontent.com/84067569/170646509-d33a3785-c2f7-4659-aba6-03f8cb0b9318.png)
![image](https://user-images.githubusercontent.com/84067569/170646557-65b1a863-2f2e-499f-896e-86843ddfea3b.png)

Here is my .graphqlconfig.yml:
![image](https://user-images.githubusercontent.com/84067569/170646680-12679be1-92bf-4942-a28b-128ddd653a3f.png)
This configuration is used on my local machine and its generating the correct files and `API.ts` isn't empty. But on Github Actions the result is different.

### Expected behavior

Expect `API.ts` to be non-empty with all types declared, and query/mutation/subscription files to be in `.ts` format.

### Reproduction steps

On Github actions workflow:
1. yarn global add @aws-amplify/cli
2. amplify codegen --nodownload

### GraphQL schema(s)

_No response_

### Log output

_No response_

### Additional information

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.