As of version 0.12.3 the default style of describing a type or field is to add a string literal instead of a comment.
https://github.com/graphql/graphql-js/blob/master/src/utilities/extendSchema.js#L44
Using the schema
"This is a description."
schema {
query: Query
}
results in a crash.
Thanks for requesting! We have this tracked for adding support in the roadmap.
I took a look at adding it in with the current lexer/parser but ran into some issues working """ syntax into it, so I detoured into writing a GraphQL-syntax based lexer instead of leaning on the Go-syntax based text/scanner.
I _think_ I'll have the time to get this feature in within ~two weeks.
A small concern, the GraphQL specification states that comments start with #. This will remain right? Because I see that "Support descriptions; deprecate comment functionality", and deprecation would violate that, or I miss understood the roadmap entry?
Yep, comments are comments, as far as the spec is concerned they should be treated as whitespace.
Descriptions are quoted strings that act like a little like comments but are added to the description field for the type they precede in the introspection api.
see also:
OK, so we talk about the "draft" of the new specification. I hope that deprecation comes after the new spec is released, not while we still are using the ancient 2016 spec :)
The schema IDL only exists in the draft spec. I think it makes sense to keep up to date with it. The current "stable" is years behind and only specifies the query syntax afaik.
Most helpful comment
The schema IDL only exists in the draft spec. I think it makes sense to keep up to date with it. The current "stable" is years behind and only specifies the query syntax afaik.