Importing ".graphql" file gives cannot resolve warning

Hi, I am using Webpack for loading  ".graphql" files with graphql-tag/loader like this:

test: /\.(graphql|gql)$/,
exclude: /node_modules/,
loader: 'graphql-tag/loader',

Then in my code, I Import this graphql file like this.


Everything works well, but Webstrom seems doesn't know that the file is processed by webpack loader. Because it shows cannot resolve symbol error.

When I console.log this object it contains a nested object with names of graphql operations. I guess Webstorm should know that this file contains these objects. A do code completion etc. when importing andnusing it.


I am also using the JS Graphql plugin and in .graphql file a works syntax completion as well.  So I guess it's not problem with this plugin. 

My .graphql file look like this.


Do you know how to resolve this problem a get to know Webstrom that ".graphql" file is exporting the object with nested object with keys exactly the same as names of graphql operations?


I appreciate your help! :)  Thanks Filip.


Comment actions Permalink

This should be handled by the plugin, I believe; please submit a ticket to

Comment actions Permalink

I'm also facing this problem, I don't see much about this online, so I decided to comment here and ask Fpapranecx if he managed to solve this.

Comment actions Permalink

I Haverkamp I Have not resolved it :( . At that time I finished work with Graphql so i wasn't trying to resolve it anyway.


Please sign in to leave a comment.