Error when trying to shadow gatsby theme with graphQL fragments #32741
Replies: 6 comments
-
Hi @DWShuo ! This sounds like a valid bug to me. If you're up for it, we'd very much appreciate if you could provide a minimal reproduction and we'll be able to take a look and maybe fix it if this a bug indeed. Thanks for using Gatsby! 💜 |
Beta Was this translation helpful? Give feedback.
-
@vladar This is the theme i am using https://www.gatsbyjs.org/packages/@wkocjan/gatsby-theme-intro/ and here is the reproducible test case https://github.com/DWShuo/graphql-shadow-bug |
Beta Was this translation helpful? Give feedback.
-
The work around is just to make a new fragment with a different name and use that, but i am just curious can someone confirm if this is a bug or is GraphQL fragment shadowing not supported? |
Beta Was this translation helpful? Give feedback.
-
Thanks for the repro! Yeah, shadowing GraphQL fragments is not supported at the moment. After looking at it I don't think this is a bug, it is just not implemented. So I think this is a valid feature request. |
Beta Was this translation helpful? Give feedback.
-
Hello guys. I've run into the same issue here. Do you have any plans on supporting it ? I think this is a very important feature, since it allows us to shadow themes with graphql fragments. Thanks ! |
Beta Was this translation helpful? Give feedback.
-
It's not only fragments. Every That's why you also have warnings like:
But surely I would love to see this fixed. I have a codebase where I shadow a fragment in every site using a theme, but I cannot put the original fragment in the theme, otherwise it will give them the error that it's duplicate. So I must shadow it in every project now, because I had comment out the original query. Even though I might not even make changes to the original fragment. |
Beta Was this translation helpful? Give feedback.
-
Summary
Im trying to make some changes to the theme wkocjan/gatsby-theme-intro/ via shadowing, one of the components contain a graphQL fragment and i get the error
Whats the correct way to resolve this issue? Thanks in advance.
Relevant information
Below is the component i tried to shadow, i only added 2 lines indicted by the arrows.
Environment (if relevant)
System:
OS: Linux 5.6 Manjaro Linux
CPU: (1) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
Shell: 5.0.17 - /bin/bash
Binaries:
Node: 14.4.0 - ~/.nvm/versions/node/v14.4.0/bin/node
Yarn: 1.22.4 - /usr/bin/yarn
npm: 6.14.5 - ~/.nvm/versions/node/v14.4.0/bin/npm
Languages:
Python: 3.8.3 - /usr/bin/python
Browsers:
Firefox: 78.0.1
npmPackages:
gatsby: ^2.23.14 => 2.23.14
npmGlobalPackages:
gatsby-cli: 2.12.51
File contents (if changed)
gatsby-config.js
: N/Apackage.json
: N/Agatsby-node.js
: N/Agatsby-browser.js
: N/Agatsby-ssr.js
: N/ABeta Was this translation helpful? Give feedback.
All reactions