Js-graphql-intellij-plugin: Unable to create a .graphqlconfig from the fragment editor window

Created on 27 Jul 2020  路  6Comments  路  Source: jimkyndemeyer/js-graphql-intellij-plugin

Describe the bug

  • Displays Erros
  • does not find .graphqlconfig
  • can created .graphqlconfig

To Reproduce
Fresh installed in WebStorm 2020.2, never used it before. Would like to use in .vue files within gridsome.
I injected graphql in the Tag (some Gridsome stuff) and the Syntax Highlighting started,
also errors are reported

image

auto complete is comming up for stuff like query,interface etc. but not for types.

So I did a "fix" to edit the graphql fragment (Alt+Enter). The an extra windows with the graphql popped up.

image

This did not help, of course i thought, without an Schema, only errors occurs.

I clicked the Wrench, and

and got

image

Great, let me create a config. But instead of a config i got an exception. But the Exception Reporter told me, I should report it to you ;)

java.lang.AssertionError
    at com.intellij.lang.jsgraphql.ide.actions.GraphQLEditConfigAction.lambda$actionPerformed$0(GraphQLEditConfigAction.java:77)
    at com.intellij.notification.impl.ui.NotificationsUtil$1.hyperlinkUpdate(NotificationsUtil.java:147)
    at java.desktop/javax.swing.JEditorPane.fireHyperlinkUpdate(JEditorPane.java:345)
    at java.desktop/javax.swing.text.html.HTMLEditorKit$LinkController.activateLink(HTMLEditorKit.java:899)
    at java.desktop/javax.swing.text.html.HTMLEditorKit$LinkController.mouseClicked(HTMLEditorKit.java:695)
    at java.desktop/java.awt.AWTEventMulticaster.mouseClicked(AWTEventMulticaster.java:278)
    at java.desktop/java.awt.Component.processMouseEvent(Component.java:6653)
    at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3345)
    at java.desktop/java.awt.Component.processEvent(Component.java:6415)
    at java.desktop/java.awt.Container.processEvent(Container.java:2263)
    at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5025)
    at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2321)
    at java.desktop/java.awt.Component.dispatchEvent(Component.java:4857)
    at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4918)
    at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4556)
    at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4488)
    at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2307)
    at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2773)
    at java.desktop/java.awt.Component.dispatchEvent(Component.java:4857)
    at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:778)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:727)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:95)
    at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:751)
    at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:749)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
    at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:748)
    at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:967)
    at com.intellij.ide.IdeEventQueue.dispatchMouseEvent(IdeEventQueue.java:904)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:836)
    at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(IdeEventQueue.java:450)
    at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:744)
    at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$9(IdeEventQueue.java:449)
    at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:802)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:503)
    at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

After that i look up the Docs and tried to create config file by myself.

I have a .grapqhlconfig at the project root, also a schema.graphql

{
  "name": "dev-days-online.de site data",
  "schemaPath": "./schema.graphql"
  }
}

But the behavior does not change, many errors in the query, not finding the config file, cant create the config etc.

Version and Environment Details
Operation system: Mac OS 10.5.6
IDE name and version: WebStorm 2020.2 (final)
Plugin version: JS GraphQL 2.5.0

Additional context
The repository with the project in question is here, the issue2009 branch.

https://github.com/DevDaysOnline/DevDaysOnline.de/tree/issue2009

bug

Most helpful comment

@carchrae thank you! It looks that this one #360 should fix the compatibility with the 2020 release. I made sure that the autocomplete using the schema works there.

I've created a separate issue for compatibility update #363.

All 6 comments

same here, running ubuntu 18.04. (and webstorm 2020.2, gql plugin 2.5.0)

looks like the issue is it cannot find the directory where the config should be found: https://github.com/jimkyndemeyer/js-graphql-intellij-plugin/blob/d83dad8bc30b528b6cc9928408ea7e77df6b16bb/src/main/com/intellij/lang/jsgraphql/ide/actions/GraphQLEditConfigAction.java#L77

edit: note this is only when trying to create a config file. it appears to find the config file when placed in the root of your project, as it will ask to introspect/etc. however, it doesn't appear to actually load the schema once it has been fetched.

unclear if this is related and/or a harmless warning, but as i noticed it. on startup

2020-08-14 12:38:33,673 [  10653]   WARN - Container.ComponentManagerImpl - Do not use constructor injection (requestorClass=com.intellij.lang.jsgraphql.ide.notifications.GraphQLScopeEditorNotificationProvider) 

so, maybe there is some failure when the plugin starts up? but may be unrelated.

i did a bit more testing, and i can confirm it is working fine/as expected on 2019.1

also, no error message re constructor injection. it appears this message arrived with 2020 if you google "Do not use constructor injection (requestorClass="

same here, running ubuntu 18.04. (and webstorm 2020.2, gql plugin 2.5.0)

looks like the issue is it cannot find the directory where the config should be found:

https://github.com/jimkyndemeyer/js-graphql-intellij-plugin/blob/d83dad8bc30b528b6cc9928408ea7e77df6b16bb/src/main/com/intellij/lang/jsgraphql/ide/actions/GraphQLEditConfigAction.java#L77

edit: note this is only when trying to create a config file. it appears to find the config file when placed in the root of your project, as it will ask to introspect/etc. however, it doesn't appear to actually load the schema once it has been fetched.

Please, could you clarify this one "however, it doesn't appear to actually load the schema once it has been fetched."? It seems that it's an unrelated problem.

edit: note this is only when trying to create a config file. it appears to find the config file when placed in the root of your project, as it will ask to introspect/etc. however, it doesn't appear to actually load the schema once it has been fetched.

Please, could you clarify this one "however, it doesn't appear to actually load the schema once it has been fetched."? It seems that it's an unrelated problem.

sure. when opening a project where there is a .grapqhlconfig file (and introspect is set to true) it will prompt to download the schema. so the plugin has correctly found the config file. however, no schema highlighting or schema names appear in the IDE, as if it has not actually loaded the schema (or likely, something has crashed in that process). you're right that it may be a separate issue to creating the config file, but it means that the plugin doesn't work at all on 2020.2, which is what i think @DerAlbertCom was referring to when he opened this issue. i reverted to the 2019 version and it works as expected there.

@carchrae thank you! It looks that this one #360 should fix the compatibility with the 2020 release. I made sure that the autocomplete using the schema works there.

I've created a separate issue for compatibility update #363.

Was this page helpful?
0 / 5 - 0 ratings