JetBrains / js-graphql-intellij-plugin

GraphQL language support for WebStorm, IntelliJ IDEA and other IDEs based on the IntelliJ Platform.
https://jimkyndemeyer.github.io/js-graphql-intellij-plugin/
MIT License
879 stars 97 forks source link

Introspection query was overwritten #509

Open dkimot opened 2 years ago

dkimot commented 2 years ago

I can't reproduce this issue but I did fix it for myself and wanted to report it. It's a doozy.

My introspection wasn't working and when I checked the body of the introspection request it looked like this: {"query":"https:\/\/server.url\/graphql"}. server.url is a placeholder. This led to the GraphQL error 'unexpected name "https"'.

I couldn't figure out where this was coming from and when I checked the source code I found out the GraphQLSettings class' serialized property introspectionQuery.

I went and checked inside .idea and sure enough there was a file called graphql-settings.xml with the key/value pair that set the introspection query to the url of my GraphQL server.

I have no idea how this happened but I've been fighting this for a few hours now. I wanted to report it and maybe help someone out along the way if they break the same thing as me.

vepanimas commented 2 years ago

Hi @dkimot! I found a similar issue https://github.com/jimkyndemeyer/js-graphql-intellij-plugin/issues/505#issuecomment-956320915, looks like you accidentally changed an introspection query in the settings (graphql-settings.xml is exactly a serialized form of them). Seems like a UX problem.

query