Js-graphql-intellij-plugin: Support directives for Apollo Link modules

Created on 10 Oct 2019  路  2Comments  路  Source: jimkyndemeyer/js-graphql-intellij-plugin

Version and Environment Details

__Operation system__:
macOS 10.14.6

__IDE name and version__:
IntelliJ IDEA 2019.2.3 (Ultimate Edition)
Build #IU-192.6817.14, built on September 24, 2019
Runtime version: 11.0.4+10-b304.69 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o

__Plugin version__:
2.2.0

Expected Behaviour

Directives in queries for apollo-link-rest (@rest, @export) and apollo-link-state (@client) should not show as errors in queries

Actual Behaviour

Apollo link queries that include @rest, @export or @client directives produce errors

Steps to Reproduce / Link to Repo with Reproduction and Instructions

image

Most helpful comment

Hi Tobi.

Thanks for using the plugin.

These error markers are intended and valid behavior since the plugin only ships with the standard directives that are part of the GraphQL spec.

For frameworks such as Apollo, or any other, it's up to the developer to declare them. There's an example with @client at https://github.com/jimkyndemeyer/graphql-config-examples/tree/master/extend-client-fields-and-directives you can look at.

Once you've declared the directives you also get completion etc.

Best regards,
Jim

All 2 comments

Hi Tobi.

Thanks for using the plugin.

These error markers are intended and valid behavior since the plugin only ships with the standard directives that are part of the GraphQL spec.

For frameworks such as Apollo, or any other, it's up to the developer to declare them. There's an example with @client at https://github.com/jimkyndemeyer/graphql-config-examples/tree/master/extend-client-fields-and-directives you can look at.

Once you've declared the directives you also get completion etc.

Best regards,
Jim

Fantastic, thanks for getting back to me @jimkyndemeyer! Declaring the directive myself worked 馃憤

Was this page helpful?
0 / 5 - 0 ratings

Related issues

vjpr picture vjpr  路  4Comments

Globegitter picture Globegitter  路  5Comments

dhay picture dhay  路  5Comments

MichaelDeBoey picture MichaelDeBoey  路  4Comments

thomastvedt picture thomastvedt  路  5Comments