API.service.ts is not updated after schema.graphql changes in Angular App
See original GitHub issueDescribe the bug I am using AWS Amplify API with GraphQL and Appsync within an Angular 8 application.
After creating a new type in my schema.graphql file, my Amplify files (e.g. API.service.ts, mutations.ts, queries.ts, subscriptions.ts) are no longer updated.
To Reproduce Steps to reproduce the behavior:
- Update amplify/backend/api/YOURPROJECT/schema.graphql
amplify push
- Affirm the update of existing graphql API and statements
- CLI provides feedback that everything worked fine, including the API.service.ts (“Code generated successfully and saved in file src/app/API.service.ts”)
- AppSync API is updated and DynamoDB ressources are correctly provided
- Queries and Mutations via AppSync Console work as expected
- Files in Angular project are not updated and I am not able to use the service for GraphQL operations
Expected behavior
- GraphQL operations should be successfully generated and saved at src/graphql in my Angular project.
- Code should be generated successfully and saved in file src/app/API.service.ts
Environment
System: OS: macOS Mojave 10.14.5 CPU: (8) x64 Intel® Core™ i5-8259U CPU @ 2.30GHz Memory: 63.90 MB / 8.00 GB Shell: 3.2.57 - /bin/bash Binaries: Node: 10.15.3 - /usr/local/bin/node npm: 6.11.3 - /usr/local/bin/npm Browsers: Chrome: 78.0.3904.87 Safari: 12.1.1 npmPackages: @angular-devkit/build-angular: ~0.803.4 => 0.803.4 @angular/animations: ~8.2.5 => 8.2.6 @angular/cdk: ~8.2.2 => 8.2.2 @angular/cli: ~8.3.4 => 8.3.4 @angular/common: ~8.2.5 => 8.2.6 @angular/compiler: ~8.2.5 => 8.2.6 @angular/compiler-cli: ~8.2.5 => 8.2.6 @angular/core: ~8.2.5 => 8.2.6 @angular/forms: ~8.2.5 => 8.2.6 @angular/language-service: ~8.2.5 => 8.2.6 @angular/material: ^8.2.2 => 8.2.2 @angular/platform-browser: ~8.2.5 => 8.2.6 @angular/platform-browser-dynamic: ~8.2.5 => 8.2.6 @angular/router: ~8.2.5 => 8.2.6 @ng-bootstrap/ng-bootstrap: ^5.1.2 => 5.1.2 @types/jasmine: ~3.3.8 => 3.3.16 @types/jasminewd2: ~2.0.3 => 2.0.6 @types/node: ~8.9.4 => 8.9.5 aws-amplify: ^1.2.4 => 1.2.4 aws-appsync: ^2.0.0 => 2.0.0 bootstrap: ^4.3.1 => 4.3.1 codelyzer: ^5.0.0 => 5.1.0 graphql: ^14.5.8 => 14.5.8 graphql-tag: ^2.10.1 => 2.10.1 hammerjs: ^2.0.8 => 2.0.8 ionicons: ^4.6.3 => 4.6.3 jasmine-core: ~3.4.0 => 3.4.0 jasmine-spec-reporter: ~4.2.1 => 4.2.1 karma: ~4.1.0 => 4.1.0 karma-chrome-launcher: ~2.2.0 => 2.2.0 karma-coverage-istanbul-reporter: ~2.0.1 => 2.0.6 karma-jasmine: ~2.0.1 => 2.0.1 karma-jasmine-html-reporter: ^1.4.0 => 1.4.2 protractor: ~5.4.0 => 5.4.2 rxjs: ^6.5.3 => 6.5.3 ts-node: ~7.0.0 => 7.0.1 tslib: ^1.10.0 => 1.10.0 tslint: ~5.15.0 => 5.15.0 typescript: ~3.5.3 => 3.5.3 uuid: ^3.3.3 => 3.3.3 zone.js: ~0.9.1 => 0.9.1 npmGlobalPackages: @angular/cli: 8.3.14 @aws-amplify/cli: 3.17.0 cordova: 9.0.0 create-react-app: 3.2.0 expo-cli: 3.4.1 firebase-tools: 7.3.2 ionic: 5.2.7 n: 4.1.0 npm: 6.11.3
Additional context My graphqlconfig.yml looks like this:
projects: wilson: schemaPath: src/graphql/schema.json includes: - src/graphql//*.ts excludes: - ./amplify/ extensions: amplify: codeGenTarget: angular generatedFileName: src/app/API.service.ts docsFilePath: src/graphql maxDepth: 6 extensions: amplify: version: 3
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (3 by maintainers)
@StevieWag which version of the CLI are you using? I was not able to reproduce this with version 4.11.0
If you run amplify api gql-compile and then amplify codegen is the API.service.ts updated? Please ensure that there are no syntax errors in your API.service.ts
This issue has been automatically locked since there hasn’t been any recent activity after it was closed. Please open a new issue for related bugs.
Looking for a help forum? We recommend joining the Amplify Community Discord server
*-help
channels for those types of questions.