Describe the bug
The amplify cli no longer appears to generate an updated API.ts after a schema change. I first noticed this while running mock
and not seeing my expected types reflected. This appears to be independent of mock
though, since just running amplify codegen
or amplify codegen types
does not resolve it.
To Reproduce
Steps to reproduce the behavior:
codegen
using typescript and default configurationExpected behavior
API.ts should be there - this appears to be a regression in the tool
Please prioritize this, if possible - this really hinders progress. Thank you.
amplify -v
3.2.0
@mwarger could you share your .graphqlconfig.yml
file with sensitive information redacted
ahh, I see what you're referring to.
projects:
tshelper:
schemaPath: amplify/backend/api/tshelper/build/schema.graphql
includes:
- src\graphql\**\*.ts
excludes:
- ./amplify/**
extensions:
amplify:
codeGenTarget: typescript
generatedFileName: src\API.ts
docsFilePath: src\graphql
maxDepth: 2
I fixed it by changing the slashes to be / instead, and it works. This is related to #2002, I bet.
We have fixed this issue https://github.com/aws-amplify/amplify-cli/pull/2212 which is pending release.
We released a new version of the CLI - v3.8.0 with a fix for this.
seeing something similar in v4.13.4.
Here's my .graphqlconfig.yml
for reference:
projects:
myproject:
schemaPath: products/web/src/graphql/schema.json
includes:
- products/web/src/graphql/**/*.js
excludes:
- amplify/**
extensions:
amplify:
codeGenTarget: typescript
generatedFileName: products/web/src/API.ts
docsFilePath: products/web/src/graphql
graphQLApiId: rzktsf3bznh5xpe362x7xoxbeu
extensions:
amplify:
version: 3
seeing something similar in v4.13.4 ...
Seeing something similar as well. API.ts
is empty however it still generates queries.
projects:
covidmars:
schemaPath: packages/service/schema.json
includes:
- packages/api/service/**/*.ts
excludes:
- ./amplify/**
extensions:
amplify:
codeGenTarget: typescript
generatedFileName: packages/service/API.ts
docsFilePath: packages/service/graphql
extensions:
amplify:
version: 3
Most helpful comment
Seeing something similar as well.
API.ts
is empty however it still generates queries.