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

Add Comments to GraphQL Queries #1670

Closed
supernova-at opened this issue Sep 11, 2019 · 3 comments
Closed

Add Comments to GraphQL Queries #1670

supernova-at opened this issue Sep 11, 2019 · 3 comments

Comments

@supernova-at
Copy link
Contributor

GraphQL supports the # character for comments in a GraphQL query.

We should document our queries just like we document our JavaScript functions, including:

  • A good semantic name
  • The purpose / description of the query
  • What each input parameter is
@brendanfalkowski
Copy link
Contributor

As I understood it (and got stung) comments were not supported in GQL unless explicitly enabled because they chose to formalize a string literal @desc instead.

graphql/graphql-js#927

It got me in trouble because IDEs didn't update to reflect the default removal of comments, and that caused the schema to fail validation in some of my early GQL work with PWA Studio.

I'd love to get comments back because it's a pain not being able to comment out code in the schema while trying things out.

I haven't found any standardized format for naming and describing queries (like DocBlock), but I wrote up some of our naming practices here (which is influenced a lot by PWA Studio's schemas): https://manuals.gravitydept.com/code/graphql/schemas

@sirugh
Copy link
Contributor

sirugh commented May 17, 2021

@magento export issue to JIRA project PWA as Story

@github-jira-sync-bot
Copy link

✅ Jira issue https://jira.corp.magento.com/browse/PWA-1759 is successfully created for this GitHub issue.

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

No branches or pull requests

4 participants