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

Syntax error parsing commented-out graphql code in schema #1157

Closed
2 tasks done
clintfoster opened this issue Jan 10, 2023 · 1 comment
Closed
2 tasks done

Syntax error parsing commented-out graphql code in schema #1157

clintfoster opened this issue Jan 10, 2023 · 1 comment
Labels
bug Something isn't working duplicate This issue or pull request already exists graphql-transformer-v2 transferred

Comments

@clintfoster
Copy link

clintfoster commented Jan 10, 2023

How did you install the Amplify CLI?

npm

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

v16.13.1

Amplify CLI Version

10.6.1

What operating system are you using?

Mac

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

Commented-out code in schema.graphql causes syntax error:

Syntax Error: mismatched brackets found in the schema. Unexpected ) at line 3 in the schema.

Expected behavior

Commented-out graphql code should be ignored.

Reproduction steps

  1. mkdir comment
  2. cd comment
  3. amplify init (accept defaults)
  4. amplify add api (graphql, blank schema, edit y, insert schema below)
  5. amplify push

Error:

"Syntax Error: mismatched brackets found in the schema. Unexpected ) at line 3 in the schema.""

Schema

type Usr @model {
  id: ID! @primaryKey
  #  orgs: [Org] @manyToMany(relationName: "OrgUsrJn")
}

Project Identifier

No response

Log output

# Put your logs below this line


Additional information

I believe this started happening after one of the recent updates to the amplify CLI since I have not made significant schema changes.

This problem is resolved by removing the parenthetical portion of the commented-out code:

(relationName: "OrgUsrJn")

In other words, the following schema with the above removed from the commented-out line works:

type Usr @model {
  id: ID! @primaryKey
  #  orgs: [Org] @manyToMany
}

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.
@josefaidt josefaidt transferred this issue from aws-amplify/amplify-cli Jan 11, 2023
@josefaidt
Copy link
Contributor

Hey @clintfoster 👋 thanks for raising this! This appears to be a duplicate of #1143, I'll close this issue in favor of tracking the existing item. Please subscribe to #1143 for further updates

@josefaidt josefaidt closed this as not planned Won't fix, can't repro, duplicate, stale Jan 11, 2023
@josefaidt josefaidt added bug Something isn't working duplicate This issue or pull request already exists graphql-transformer-v2 and removed pending-triage labels Jan 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working duplicate This issue or pull request already exists graphql-transformer-v2 transferred
Projects
None yet
Development

No branches or pull requests

2 participants