Js-graphql-intellij-plugin: Support Inline Markdown Documentation

Created on 7 Nov 2018  路  9Comments  路  Source: jimkyndemeyer/js-graphql-intellij-plugin

Version and Environment Details

__Operation system__: macOS High Sierra 10.13.5

__IDE name and version__: WebStorm 2018.2.5

__Plugin version__: 1.7.2

Expected Behaviour

Inline markdown comments with double quotes (single-line) and triple double quotes (multi-line) which apollo-server at least supports as a means of documenting the scheme are syntax highlighted and maybe interpreted by the plugin.

Actual Behaviour

Inline markdown comments are considered an error:

Error:(5, 3) Syntax Error GraphQL (5:3) Unexpected String

Screenshot of error: Error:(5, 3) Syntax Error GraphQL (5:3) Unexpected String

And syntax highlighted as errors:

Screenshot of syntax highlighted

Steps to Reproduce / Link to Repo with Reproduction and Instructions

  1. Create a JS file in an apollo-server project
  2. Import the gql template template tag from apollo-server
  3. Create a template literal, tag it with gql, and fill it with a valid GraphQL type using the standard GraphQL Schema Language
  4. Add a single- or multi-line comment to the type per the documentation here.
v2-alpha v2-architecture

Most helpful comment

Hi Brandon.

Thanks for using the plugin.

Documentation in quotes/tripe quotes was a breaking language change that was added to the GraphQL spec after the V1.x parser and language service for this plugin was built. V1 expects documentation to be in # line comments above types and fields.

V2 of this plugin follows that newer language spec, but is still work in progress. Currently V2 shows documentation in completions, but the quick documentation viewer found in V1 is yet to be built.

You can read more about V2 in #164 and https://github.com/jimkyndemeyer/js-graphql-intellij-plugin/releases and try it out if you prefer to use quotes for the documentation.

I'll keep this issue around as markdown support would be a nice addition to V2.

Best regards,
Jim.

All 9 comments

Hi Brandon.

Thanks for using the plugin.

Documentation in quotes/tripe quotes was a breaking language change that was added to the GraphQL spec after the V1.x parser and language service for this plugin was built. V1 expects documentation to be in # line comments above types and fields.

V2 of this plugin follows that newer language spec, but is still work in progress. Currently V2 shows documentation in completions, but the quick documentation viewer found in V1 is yet to be built.

You can read more about V2 in #164 and https://github.com/jimkyndemeyer/js-graphql-intellij-plugin/releases and try it out if you prefer to use quotes for the documentation.

I'll keep this issue around as markdown support would be a nice addition to V2.

Best regards,
Jim.

How do I install the v2 version of this plugin?

Hi @nanandn

The installation steps for v2 are included in the releases under the "Getting and installing the alpha releases" section. See https://github.com/jimkyndemeyer/js-graphql-intellij-plugin/releases/tag/2.0.0-alpha-3 for the latest release.

Best regards,
Jim

@jimkyndemeyer Thanks. Installed the update.

@jimkyndemeyer A couple of things after the update...

  1. Syntax highlighting not working in graphqls files.
  2. In the old version there was a refresh/restart button in the graphql tool window which would load the schema again. The new version does not have that. Is that a bug?
  3. In the new version, I see errors - "No type information available due to schema errors."

@nanandn Please read through the documentation on schema discovery in the release link I posted earlier for you. Version 2 uses a completely different and more flexible approach.

Regarding .graphqls files, that's included for backwards compatibility in the next alpha, but the official file extension is .graphql. If you need to use graphqls files now you can associate them with the GraphQL format using the "Editor -> File types" settings in your IDE.

For furture reference please add your feedback to #164 I'll remove the comments here later as they don't belong in this issue.

@jimkyndemeyer Sorry. I realized the documentation mentions the new approach after I added my comment. Reading the doc now.

Just released https://github.com/jimkyndemeyer/js-graphql-intellij-plugin/releases/tag/2.0.0-alpha-4 with support for markdown in documentation.

Best regards,
Jim.

Closing this as markdown documentation has been supported since 2.0.0-alpha-4.

Was this page helpful?
0 / 5 - 0 ratings