You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since we've switched from [gatsby-transformer-javascript-static-exports] to [gatsby-transformer-javascript-frontmatter], and limited the focus of the plugin to frontmatter in javascript files (as described by @jbolda in #3795), I'd like to suggest that the plugin only create nodes from javascript files that actually export frontmatter.
Right now, the plugin seems to create a javascriptFrontmatter node for each file with a media type of application/javascript before actually checking for the existence of exports.frontmatter. This can produce a lot of false positives, resulting in queries like…
Filtering in this way is not really a big deal, but it seems silly to have to explicitly exclude nodes that don't have frontmatter when you're querying for nodes that have frontmatter.
I don't think I'm capable of offering a PR. If there's some other way I can help, or if there's a use case for the current behavior that I'm missing, please let me know.
Thanks.
The text was updated successfully, but these errors were encountered:
Since we've switched from [gatsby-transformer-javascript-static-exports] to [gatsby-transformer-javascript-frontmatter], and limited the focus of the plugin to frontmatter in javascript files (as described by @jbolda in #3795), I'd like to suggest that the plugin only create nodes from javascript files that actually export frontmatter.
Right now, the plugin seems to create a
javascriptFrontmatter
node for each file with a media type ofapplication/javascript
before actually checking for the existence ofexports.frontmatter
. This can produce a lot of false positives, resulting in queries like…Filtering in this way is not really a big deal, but it seems silly to have to explicitly exclude nodes that don't have frontmatter when you're querying for nodes that have frontmatter.
I don't think I'm capable of offering a PR. If there's some other way I can help, or if there's a use case for the current behavior that I'm missing, please let me know.
Thanks.
The text was updated successfully, but these errors were encountered: