amplify-category-api icon indicating copy to clipboard operation
amplify-category-api copied to clipboard

amplify mock api error during resolver parsing

Open jo2 opened this issue 2 years ago • 22 comments

How did you install the Amplify CLI?

npm install -g @aws-amplify/cli

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

18.16.0

Amplify CLI Version

12.1.1

What operating system are you using?

Windows 10

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

No manual changes made

Describe the bug

When running amplify mock api I get the following console output:

✅ GraphQL schema compiled successfully.                                                                                                                                                                      
                                                                                                                                                                                                             
Edit your schema at F:\git\BookStore-Amplify\amplify\backend\api\adessobookstore\schema.graphql or place .graphql files in a directory at F:\git\BookStore-Amplify\amplify\backend\api\adessobookstore\schema
Creating new table DataStore
Creating new table AuthorTable
Creating new table BookTable
Failed to start API Mocking. Running cleanup tasks.
Reason: Error:Parse error on resolvers/Query.syncAuthors.req.vtl:11:50 
Parse error on line 12:
...tx.stash.authFilter.or )      #if( $fil
-----------------------^
Expecting 'ID', 'CONTENT', got '||'

Expected behavior

I expect amplify mock api to start up a mock environment of the backend api.

Reproduction steps

  1. check out this demo repo
  2. run amplify init
  3. run amplify mock api

Project Identifier

345e114ba9485c7429ea7f372fe4e78b

Log output

# Put your logs below this line
✅ GraphQL schema compiled successfully.

Edit your schema at C:\Users\teklote\Documents\git\BookStore-Amplify\amplify\backend\api\adessobookstore\schema.graphql or place .graphql files in a directory at C:\Users\teklote\Documents\git\BookStore-Amplify\amplify\backend\api\adessobookstore\schema
Creating new table DataStore
Creating new table AuthorTable
Creating new table BookTable
Failed to start API Mocking. Running cleanup tasks.
Reason: Error:Parse error on resolvers/Query.syncAuthors.req.vtl:11:50 
Parse error on line 12:
...tx.stash.authFilter.or )      #if( $fil
-----------------------^
Expecting 'ID', 'CONTENT', got '||'

Additional information

No response

Before submitting, please confirm:

  • [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.

jo2 avatar Jul 05 '23 11:07 jo2