-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Support for string literals as description #86
Comments
maybe start with comment symbol is better. like //This is a description.
schema {
query: Query
} |
gqlgen should stick to the reference implementation. The implementation states that descriptions should be written as string literals. Comments are no longer used for descriptions. /**
* Descriptions are defined as preceding string literals, however an older
* experimental version of the SDL supported preceding comments as
* descriptions. Set to true to enable this deprecated behavior.
*
* Default: false
*/
commentDescriptions?: boolean, Source: https://github.com/graphql/graphql-js/blob/master/src/utilities/extendSchema.js#L44 |
@SpaceHeroGuide got it. thanks! |
The blocker on this, and a few other issues is the parser we use for schema. Upstream issue graph-gophers/graphql-go#196 Another alternative is to fork https://github.com/tmc/graphql and get it up to date. A parser generator would be nice way nicer to work with than a hand rolled parser. |
Fixed in 0.4.0 |
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
Expected Behaviour
Parsing a schema with string literals as descriptions and generating the Golang files.
Actual Behavior
Crashing due to invalid syntax.
Minimal graphql.schema and models to reproduce
Results in
unable to parse schema: graphql: syntax error: unexpected "\"This is a comment.\"", expecting Ident (line 1, column 1)
The text was updated successfully, but these errors were encountered: