gatsby-transfomer-sharp
adds childImageSharp
to wrong types.
#27924
Labels
status: confirmed
Issue with steps to reproduce the bug that’s been verified by at least one reviewer.
type: bug
An issue or pull request relating to a bug in Gatsby
Description
During
onCreateNode
the plugin only checks whether theextension
field exists and is populated with a supported extension, before adding thechildImageSharp
field to the node, and this behavior is not configurable.In Craft CMS, Assets are content elements that describe a file, so it's perfectly normal for them to have a populated
extension
field, however, they are not files themselves. This leads tochildImageSharp
fields being created on them that always results in an error.Steps to reproduce
Have an external data source and have at least one type that has the
extension
field populated with a valid image extension.Run
gatsby develop
, openhttp://localhost:800/__graphql
and query for the corresponding Gatsby node. Observe that achildImageSharp
field is present.You can use the following project to reproduce it: https://github.com/craftcms/starter-blog/blob/master/headless-front-end/gatsby/README.md, but it'll be a little bit involved.
Expected result
The
childImageSharp
field should not appear based on one field existing or not.Actual result
It does appear.
The text was updated successfully, but these errors were encountered: