Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Got gql "Syntax Error" after amplify pull, cannot compile or push any schema changes or roll back #13751

Closed
2 tasks done
smgadget opened this issue May 1, 2024 · 2 comments
Closed
2 tasks done
Labels
pending-triage Issue is pending triage

Comments

@smgadget
Copy link

smgadget commented May 1, 2024

How did you install the Amplify CLI?

No response

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

No response

Amplify CLI Version

12.11.1

What operating system are you using?

Mac (14.4.1 (23E224)

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

No

Describe the bug

During grapql schema (index) update via amplify push, I accidently added "`" at the end of schema.graphql without noticing. Somehow the "`" change got staged into the schema update...??? and got deployed.
At the end of the update, console outputs Syntax Error: Cannot parse the unexpected character "`".
Then I tried to remove the "`", plus various other changes to correct it, but no matter how I try, the schema just won't compile, verified via amplify api gql-compile . e.g via push --iterative-rollback, push --force, etc.
Any help is appreciated.

Expected behavior

The syntax error should be fixable via correction.

Reproduction steps

  1. update shcema.graphql
  2. during the update, modify shcema.graphql by adding a "`" at the end of the file.
  3. got Syntax Error: Cannot parse the unexpected character "`". after the api changes

Project Identifier

Project Identifier: 3785e935e3a1b64d4d113aaf51c7dea5

Log output

... ⠋ Fetching updates to backend environment: production from ⠙ Fetching updates to backend environment: production from ✔ Successfully pulled backend environment production from the cloud. ⠙ Building resource ...

⠙ Building resource ...✅ GraphQL schema compiled successfully.

Edit your schema at...
Current Environment: production

┌──────────┬───────────────────────────┬───────────┬───────────────────┐
│ Category │ Resource name │ Operation │ Provider plugin │
├──────────┼───────────────────────────┼───────────┼───────────────────┤
│ Api │ ... │ Update │ awscloudformation │
├──────────┼───────────────────────────┼───────────┼───────────────────┤
│ ──────────────────────┴───────────┴───────────────────┘

✅ GraphQL schema compiled successfully.

...
⠋ Building resource ...✅ GraphQL schema compiled successfully.

...
Deployment completed.
Deployed api ... [ ======================================== ] 18/18
GraphQLAPITransformerSchema3C… AWS::AppSync::GraphQLSchema UPDATE_IN_PROGRESS Wed May 01 2024 09:48:57…
GraphQLAPIDefaultApiKey215A6D… AWS::AppSync::ApiKey UPDATE_IN_PROGRESS Wed May 01 2024 09:48:57…

Deployed (2 of 2)
✔ Generated GraphQL operations successfully and saved at src/graphql
Deployment state saved successfully.
🛑 Syntax Error: Cannot parse the unexpected character "`".

Learn more at: https://docs.amplify.aws/cli/project/troubleshooting/

Session Identifier: d1ebf6fc-ad89-43f0-8080-523b0f378e66

Additional information

No response

Before submitting, please confirm:

  • I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
  • I have removed any sensitive information from my code snippets and submission.
@smgadget smgadget added the pending-triage Issue is pending triage label May 1, 2024
@smgadget
Copy link
Author

smgadget commented May 1, 2024

Looks like it is an existing issue upon further check. Closing issue to avoid duplication.

@smgadget smgadget closed this as completed May 1, 2024
Copy link

github-actions bot commented May 1, 2024

This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pending-triage Issue is pending triage
Projects
None yet
Development

No branches or pull requests

1 participant