I would like to use custom data source for theme I'm using and I'm not sure which is the best way to do that, anyone has a thought on that?
Can you link the Theme in question? I'm assuming you want to keep the presentation portion of the theme, but switch out the CMS / data layer?
If that's the case, I don't believe it's directly possible to use component shadowing as you can only do such on files in the src directory of a theme.
In the early times of Themes, there was suggestions of separation of "data themes" and "presentation themes" where if you liked a certain visual theme, you could use it with any data source as long as it implemented an abstract data format for that, for instance a BlogPost type. That said most themes haven't gone down that route and instead focus more on an all-in-one solution where everything is in a single theme.
You're right this is the theme https://www.gatsbyjs.org/packages/@narative/gatsby-theme-novela/.
And I don't my to do some "custom coding", I'm new in gatsby though, so I thought there maybe some common ways to do this kind of optimization.
So it does look like novela has a generic Article data-type with current support for MDX and Contentful, so what I'd say a good start is to open an issue on their repo asking about support for the data source you are wanting to be implemented.
Thank you for opening this!
You can't really "override" this file in a theme, you need prerequisites in the theme itself to enable customization for that. As Benjamin said the theme you mentioned has generic data interfaces which you could extend with your data type. Here's an example of a theme of mine where MDX gets replaced with YAML: https://github.com/LekoArts/minimal-blog-yaml/blob/master/gatsby-node.js
But for more specific instructions I'd also advise to ask on their repository!
We're marking this issue as answered and closing it for now but please feel free to comment here if you would like to continue this discussion. We also recommend heading over to our communities if you have questions that are not bug reports or feature requests. We hope we managed to help and thank you for using Gatsby!
Guys, I really think Gatsby needs a way to overwrite(or extend/merge with) gatsby-*.js files.
I am using a theme(@rocketseat/gatsby-theme-doc), that defines GraphQL type for its frontmatter, in gatsby-node.js. The problem is it defines this type with @dontInfer so I can't extend it cleanly.
Also with this theme, I can't possibly add gatsby-remark-images-medium-zoom to themes, gatsby-config.js.
Thanks!