Skip to content
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

Apollo Link State queries not supported #129

Closed
anselmdk opened this issue Mar 2, 2018 · 8 comments
Closed

Apollo Link State queries not supported #129

anselmdk opened this issue Mar 2, 2018 · 8 comments
Labels

Comments

@anselmdk
Copy link

anselmdk commented Mar 2, 2018

Apollo Link State (client state handling for Apollo) uses the @client directive for queries that query the local state. They can look like this:

query {
  amount @client {
    amount
  }
}

These seem to not be supported in the plugin, see attached:

2018-03-02_10h53_22

@laukaichung
Copy link

Is it possible to temporarily ignore the errors from these Apollo Link State's queries ?

@anselmdk
Copy link
Author

It's just underlining them with red, beyond that everything's fine.

@scottburch
Copy link

I would argue that underlining them in red is not fine. That causes the IDE to label the code as invalid. I rely on that indicator heavily while coding to find syntax mistakes. Reading the commit comments it looks like a fix for this is in progress?

@LavaToaster
Copy link

LavaToaster commented Apr 2, 2018

If you add the following into your GraphQL schema, it should prevent this from showing as an error.

directive @client on FIELD

@laukaichung
Copy link

What tool do you use to combine server side (Apollo server) schema and client side schema (Apollo Link State) to work with this plugin?

@LavaToaster
Copy link

I use this from here.

My slightly modified one is this, because the source uses the https module and I had a http introspection endpoint.

@jimkyndemeyer
Copy link
Collaborator

jimkyndemeyer commented Jun 19, 2018

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

As part of that, the plugin will pick up any client fields and directives that you declare as part of your client schema using GraphQL SDL.

Use the extend keyword to extend your existing server schema types with client fields.

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

Edit: Directives placed on the schema types and fields appear to be reported as invalid locations and don't show up in completions. Expect this to be fixed in an upcoming alpha.

@jimkyndemeyer
Copy link
Collaborator

Schema directives fixed in https://github.com/jimkyndemeyer/js-graphql-intellij-plugin/releases/tag/2.0.0-alpha-3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants