Closed TheNavigateur closed 1 year ago
Hi @TheNavigateur! Documentation strings for operations are not supported in GraphQL. https://spec.graphql.org/October2021/#sec-Descriptions https://spec.graphql.org/October2021/#sec-Language.Operations
For example, if you try to reformat that snippet with the GraphQL plugin for Prettier, you'll get the following exception:
"""
Comment
"""
query {
node {
id
}
}
Syntax Error: Unexpected Name "query". (4:1)
2 | Comment
3 | """
> 4 | query {
| ^
5 | node {
6 | id
7 | }
SyntaxError: Syntax Error: Unexpected Name "query". (4:1)
2 | Comment
3 | """
> 4 | query {
| ^
5 | node {
6 | id
7 | }
Thank you for this plugin!
I am wondering if there can be support for "documentation comments" as per https://dgraph.io/docs/graphql/schema/documentation/#schema-documentation-processed--by-generated-api
When I use them, they build OK and insert the comments into the generated class's JavaDoc, but the parsing describes and error and subsequent syntax highling fails:
When inserting a
"""
comment before aquery
, such as:I get the following error message at end of the last
"""
:directive, enum, input, interface, scalar, schema, type or union expected, got 'query'
. There is no syntax highlighting after this error in the GraphQL file.Normal comments with
#
work fine but they don't get inserted into the generated class's JavaDoc.Operation system: Windows 10 IDE name and version: Android Studio Dolphin | 2021.3.1 Plugin version: 3.3.0