Js-graphql-intellij-plugin: Support docstrings

Created on 6 Dec 2017  路  9Comments  路  Source: jimkyndemeyer/js-graphql-intellij-plugin

I believe the draft SDL spec now supports docstring-style string descriptions. So this reports as an error, when I'm pretty sure the following should be valid:

"""
Nullable because the field refers to data that may be absent. This is only
required if there is another nullability decorator, otherwise, it is implicit 
that a nullable field is optional.
"""
directive @nullableOptional on FIELD
enhancement v2-alpha v2-architecture

Most helpful comment

The 2.0 alpha follows the latest GraphQL language draft spec as of June 2018.

See 2.0.0-alpha-2 if you'd like to try it and help test it.

All 9 comments

This also relates to #121 as only newer GraphQL libraries will support this.

I don't see this mentioned at http://facebook.github.io/graphql/ yet. Do you have any additional info?

I think the spec for comment descriptions
which is already part of graphql/[email protected]
could be found here:
https://github.com/graphql/graphql-js/pull/927

Would be great if it can be fixed in our IDE instead of other tools. How can we support?

I think it's important to get this fixed because it's standard in graphql with version 0.12. This means, that all other tools support this new syntax.

It's important to make a clear distinction between the versioned GraphQL specification and the graphql-js reference implementation.

Given the language-agnostic nature of GraphQL, this plugin interacts with endpoints written in a variety of programming languages and frameworks, each supporting potentially different versions of the GraphQL specification.

With breaking changes coming into play, this has introduced the need for #121. I cannot simply upgrade the language service to use [email protected] without breaking compatibility with a large number of existing endpoints.

Going forward, it might make sense to allow plugin users to pick the GraphQL spec version that their endpoint supports. In addition to the released spec versions, a "next" version could be used to point at a language service that is powered by the latest graphql-js, enabling access to RFC features.

For reference, the versions of the GraphQL specification can be found at https://github.com/facebook/graphql/releases

The relevant PR for this change is https://github.com/facebook/graphql/pull/90 and is still not part of a named GraphQL spec version.

Bump.

The PR now seems to be merged and descriptions can be very useful when doing an introspection query.

Thanks for the hard work 馃檹

Thanks @jimkyndemeyer for the amazing plugin!

Any updates on this matter? The """ syntax is officially in GraphQL spec draft now:
http://facebook.github.io/graphql/draft/#sec-String-Value
http://facebook.github.io/graphql/draft/#sec-Descriptions

The 2.0 alpha follows the latest GraphQL language draft spec as of June 2018.

See 2.0.0-alpha-2 if you'd like to try it and help test it.

Still in progress?

WebStorm 2019.1 EAP
Build #WS-191.6014.17, built on March 6, 2019
WebStorm EAP User
Expiration date: April 5, 2019
JRE: 1.8.0_202-release-1483-b31 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows 8.1 6.3

JS GraphQL: v 2.0.0-alpha-8

image

Still """ triple quote comment """ turns out into a warning?

Thank you for awesome tool :1st_place_medal:

@blacksmoke26 The GraphQL grammar only allows the single/triple quote strings to be used as descriptions in type system definitions, hence the expectation that a definition follows immediately after.

Comments are still single line and marked by #.

See https://facebook.github.io/graphql/June2018/#sec-Appendix-Grammar-Summary.Document

Was this page helpful?
0 / 5 - 0 ratings

Related issues

idkjs picture idkjs  路  3Comments

BerndWessels picture BerndWessels  路  5Comments

tkvlnk picture tkvlnk  路  3Comments

victororlyk picture victororlyk  路  3Comments

vjpr picture vjpr  路  4Comments