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

GraphQL API change failed due to blank comment #173

Closed
4 tasks done
kylekirkby opened this issue Jul 26, 2021 · 4 comments
Closed
4 tasks done

GraphQL API change failed due to blank comment #173

kylekirkby opened this issue Jul 26, 2021 · 4 comments
Labels

Comments

@kylekirkby
Copy link

Before opening, please confirm:

  • I have installed the latest version of the Amplify CLI (see above), and confirmed that the issue still persists.
  • I have searched for duplicate or closed issues.
  • I have read the guide for submitting bug reports.
  • I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.

How did you install the Amplify CLI?

npm

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

15.7

Amplify CLI Version

5.0.1

What operating system are you using?

Windows 10 / Ubuntu 20.04 WSL

Amplify Categories

api

Amplify Commands

push

Describe the bug

I'd recently made some updates to my schema.graphql file but failed to fill in a comment for a field. E.g

	"""
	"""
	videoId: String
	"""
	An array of S3 UrLs
	"""
	publications: [String] @function(name: "getPublicationSignedUrl-${env}")

Running amplify api gql-compile returned a succesful compilation, but upon pushing the changes, the stack failed in Cloudformation with:

Reason: Schema Creation Status is FAILED with details: Failed to parse schema document - ensure it's a valid SDL-formatted document.

Updating the schema.graphql file with a valid comment fixed the issue.

Expected behavior

Validate for blank comments on compilation of the GraphQL schema.

Reproduction steps

  1. Create a schema with a blank comment above a field.
  2. Run amplify api gql-compile to check the schema is valid (which it isn't according to AppSync.
  3. Try to push the changes
  4. See that the push fails
  5. Add a comment
  6. Push again and see that it pushes the changes succesfully.

GraphQL schema(s)

# Put schemas below this line

Log output

# Put your logs below this line


Additional information

No response

@josefaidt josefaidt self-assigned this Jul 26, 2021
@josefaidt
Copy link
Contributor

Hey @kylekirkby 👋 thanks for raising this! I was able to successfully reproduce with the steps provided, and I agree that the validation could be executed during amplify api gql-compile to prevent unsuccessful push attempts.

Sample GraphQL schema used for reproduction:

type Todo @model {
  """

  """
  id: ID!
  """
  name the todo
  """
  name: String!
  """
  describe the todo
  """
  description: String
}

@josefaidt josefaidt removed their assignment Jul 26, 2021
@josefaidt
Copy link
Contributor

Hey @kylekirkby after further review this appears to be better suited as a feature-request for the validation. Please note GraphQL descriptions have an active issue in the AppSync community and another, relevant issue in this repo for GraphQL comments and descriptions.

\cc @renebrandel for bug triage visibility

@josefaidt josefaidt added feature-request New feature or request and removed bug Something isn't working labels Aug 5, 2021
@mgarabedian
Copy link

@kylekirkby Thanks for logging this, I came across this earlier and had spent a good amount of time trying to understand why my schema deployment was failing ( with a non-helpful Cloudformation error ). Blank comment was the issue. Hopefully it can be patched.

@alharris-at alharris-at transferred this issue from aws-amplify/amplify-cli May 17, 2022
@renebrandel
Copy link
Contributor

I'm closing this from the Amplify end as the tracking ticket as this requires changes on the AppSync service. (Tracked in the ticket above)

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

No branches or pull requests

4 participants