[Question] Unknown fragment, load fragment from node_modules?
See original GitHub issueVersion and Environment Details
Operation system: macOS
IDE name and version: Webstorm 2019.2
Plugin version: 2.2.0
I have a gatsby project where I get this warning “Unknown fragment GatsbyImageSharpFluid”. I do not have a definition for this fragment in my own source code, but the definition exists in package gatsby-transformer-sharp
. It is a fragment that defines all the fields needed for other plugins to work.
Question:
Can I configure something to make the plugin understand these fragments located in node_modules/gatsby-transformer-sharp/fragments.js
? The fragments are exported from the package, I tried importing them but still not working.
Here is a snippet from node_modules/gatsby-transformer-sharp/fragments.js
:
const GatsbyImageSharpFluid = _gatsby.graphql`
fragment GatsbyImageSharpFluid on ImageSharpFluid {
base64
aspectRatio
src
srcSet
sizes
}
`;
/**
* Traced SVG fluid images
* @type {Fragment}
*/
exports.GatsbyImageSharpFluid = GatsbyImageSharpFluid;
I guess I could just copy paste the fragment definitions to my own source code, but is there a way to discover fragments in npm packages? 😃
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:5
Top GitHub Comments
Hi Thomas.
Thanks for using the plugin.
Please see https://github.com/jimkyndemeyer/js-graphql-intellij-plugin/issues/236 for how to make this work.
Best regards, Jim.
Hey @jimkyndemeyer is this work-around included in the docs for js-graphql? Perhaps I skimmed too quick, but if it’s not, what do you think about adding a note? Particularly for those working with Gatsby.