`amplify add codegen --apiId
√ Getting API details
Successfully added API ChatQL to your Amplify project
? Choose the code generation language target angular
? Enter the file name pattern of graphql queries, mutations and subscriptions src\graphql*\.graphql
? Do you want to generate/update all possible GraphQL operations - queries, mutations and subscriptions Yes
? Enter the file name for the generated code src\app\API.service.ts
? Do you want to generate code for your newly created GraphQL API Yes
√ Downloaded the schema
√ Generated GraphQL operations successfully and saved at src\graphql
Generating2018-11-17T06:52:11.737Z - error: uncaughtException: ':' expected. (555:7)
553 | const gqlAPIServiceArguments : any = {
554 | id
555 | name
| ^
556 | }
557 | if (createdAt) {
558 | gqlAPIServiceArguments.createdAt = createdAt date=Sat Nov 17 2018 12:22:11 GMT+0530 (India Standard Time), pid=20376, uid=null, gid=null, cwd=C:\Users\saran\Desktop\Banyan Infra\aws-mobile-appsync-chat-starter-angular, execPath=C:\Program Files\nodejs\node.exe, version=v8.12.0, argv=[C:\Program Files\nodejs\node.exe, C:\Users\saran\AppData\Roaming\npm\node_modules\@aws-amplify\cli\bin\amplify, codegen, add, --apiId, 32mnfsfxrzc7hfdrju6nbvyige], rss=156618752, heapTotal=127332352, heapUsed=102838216, external=5598569, loadavg=[0, 0, 0], uptime=11304.8536158, trace=[column=267, file=C:\Users\saran\AppData\Roaming\npm\node_modules\@aws-amplify\cli\node_modules\prettier\parser-typescript.js, function=e, line=1, method=null, native=false, column=2011548, file=C:\Users\saran\AppData\Roaming\npm\node_modules\@aws-amplify\cli\node_modules\prettier\parser-typescript.js, function=Object.parse, line=1, method=parse, native=false, column=19, file=C:\Users\saran\AppData\Roaming\npm\node_modules\@aws-amplify\cli\node_modules\prettier\index.js, function=Object.parse$2 [as parse], line=10599, method=parse$2 [as parse], native=false, column=23, file=C:\Users\saran\AppData\Roaming\npm\node_modules\@aws-amplify\cli\node_modules\prettier\index.js, function=coreFormat, line=13762, method=null, native=false, column=16, file=C:\Users\saran\AppData\Roaming\npm\node_modules\@aws-amplify\cli\node_modules\prettier\index.js, function=format, line=13938, method=null, native=false, column=12, file=C:\Users\saran\AppData\Roaming\npm\node_modules\@aws-amplify\cli\node_modules\prettier\index.js, function=formatWithCursor, line=13950, method=null, native=false, column=15, file=C:\Users\saran\AppData\Roaming\npm\node_modules\@aws-amplify\cli\node_modules\prettier\index.js, function=null, line=41800, method=null, native=false, column=12, file=C:\Users\saran\AppData\Roaming\npm\node_modules\@aws-amplify\cli\node_modules\prettier\index.js, function=Object.format, line=41819, method=format, native=false, column=19, file=C:\Users\saran\AppData\Roaming\npm\node_modules\@aws-amplify\cli\node_modules\amplify-graphql-types-generator\src\angular\index.ts, function=Object.generateSource, line=37, method=generateSource, native=false, column=18, file=C:\Users\saran\AppData\Roaming\npm\node_modules\@aws-amplify\cli\node_modules\amplify-graphql-types-generator\src\generate.ts, function=generate, line=98, method=null, native=false], stack=[SyntaxError: ':' expected. (555:7), 553 | const gqlAPIServiceArguments : any = {, 554 | id, > 555 | name, | ^, 556 | }, 557 | if (createdAt) {, 558 | gqlAPIServiceArguments.createdAt = createdAt, at e (C:\Users\saran\AppData\Roaming\npm\node_modules\@aws-amplify\cli\node_modules\prettier\parser-typescript.js:1:267), at Object.parse (C:\Users\saran\AppData\Roaming\npm\node_modules\@aws-amplify\cli\node_modules\prettier\parser-typescript.js:1:2011548), at Object.parse$2 [as parse] (C:\Users\saran\AppData\Roaming\npm\node_modules\@aws-amplify\cli\node_modules\prettier\index.js:10599:19), at coreFormat (C:\Users\saran\AppData\Roaming\npm\node_modules\@aws-amplify\cli\node_modules\prettier\index.js:13762:23), at format (C:\Users\saran\AppData\Roaming\npm\node_modules\@aws-amplify\cli\node_modules\prettier\index.js:13938:16), at formatWithCursor (C:\Users\saran\AppData\Roaming\npm\node_modules\@aws-amplify\cli\node_modules\prettier\index.js:13950:12), at C:\Users\saran\AppData\Roaming\npm\node_modules\@aws-amplify\cli\node_modules\prettier\index.js:41800:15,
at Object.format (C:\Users\saran\AppData\Roaming\npm\node_modules\@aws-amplify\cli\node_modules\prettier\index.js:41819:12), at Object.generateSource (C:\Users\saran\AppData\Roaming\npm\node_modules\@aws-amplify\cli\node_modules\amplify-graphql-types-generator\src\angular\index.ts:37:19), at generate (C:\Users\saran\AppData\Roaming\npm\node_modules\@aws-amplify\cli\node_modules\amplify-graphql-types-generator\src\generate.ts:98:18)]`
This is unrelated to the app. Looks like an issue with the Amplify CLI.
Suggest to either upgrade to the latest version of the CLI or create an issue in the AWS Amplify repository.
`amplify add codegen --apiId √ Getting API details Successfully added API ChatQL to your Amplify project ? Choose the code generation language target angular ? Enter the file name pattern of graphql queries, mutations and subscriptions src\graphql*\.graphql ? Do you want to generate/update all possible GraphQL operations - queries, mutations and subscriptions Yes ? Enter the file name for the generated code src\app\API.service.ts ? Do you want to generate code for your newly created GraphQL API Yes √ Downloaded the schema √ Generated GraphQL operations successfully and saved at src\graphql
Followed every step but got the following error.