You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, when using it with format-grahpql the comments all disappear.
I would have guessed that because comments aren't necessarily part of the GraphQL spec, that any parser from GraphQL might just eat them, and not provide them as AST nodes, but in fact the spec does define comments:
Thanks @gajus - I suspected something like this, Rust's serde YAML suffers the same problem, because the underlying YAML parser doesn't preserve comments. (Ruby also had the same problem with the parser tools for the first 20 years it existed, and only recently learned to preserve comments on the AST)
We use
format-graphql
along side thegraphql-schema-linter
package (via https://pre-commit.com/)graphql-schema-linter
provides the means to disable some of it's lint checks (unused types, camel casing) https://github.com/cjoudrey/graphql-schema-linter#inline-rule-overridesHowever, when using it with
format-grahpql
the comments all disappear.I would have guessed that because comments aren't necessarily part of the GraphQL spec, that any parser from GraphQL might just eat them, and not provide them as AST nodes, but in fact the spec does define comments:
The text was updated successfully, but these errors were encountered: