New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix early bail when testing if string field should link to File node #6504
Conversation
Deploy preview for using-drupal ready! Built with commit 77b340a |
Deploy preview for gatsbygram ready! Built with commit 77b340a |
Looks like there's a few other places we make this check? https://github.com/gatsbyjs/gatsby/search?q=%22application%2Foctet-stream%22&unscoped_q=%22application%2Foctet-stream%22 |
Yeah, I checked that before and just didn't update it because it would work: gatsby/packages/gatsby-source-filesystem/src/create-file-node.js Lines 43 to 49 in 27a4f4b
this will actually keep v1 behaviour of setting application/octet-stream for File nodes if mime.getType will report null , but probably noone will test against either null or application/octet-stream
But I guess if it doesn't matter let's not diverge from current |
Deploy preview for using-postcss-sass failed. Built with commit 16e79e7 https://app.netlify.com/sites/using-postcss-sass/deploys/5b4f136f82d3f10a7424957a |
Deploy preview for image-processing failed. Built with commit 16e79e7 https://app.netlify.com/sites/image-processing/deploys/5b4f137082d3f10a7424957e |
Deploy preview for using-postcss-sass failed. Built with commit 77b340a https://app.netlify.com/sites/using-postcss-sass/deploys/5b4f2108c6aed65949b90ee0 |
Deploy preview for image-processing failed. Built with commit d9b0aff https://app.netlify.com/sites/image-processing/deploys/5b4f13a582d3f116bf249549 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 thanks @pieh
…atsbyjs#6504) * fix early bail when for file inferring * remove any `application/octet-stream` handling to be in line with mime@2 behaviour * this can be shorter, doh!
mime@^1.0.0
used to return'application/octet-stream'
for unkown filenames - this was changed inmime@^2.0.0
and now it returnsnull
( ref: broofa/mime#139 )When we upgraded
mime
and didn't adjust this caused every string field to go through quite expensiveFile
nodes lookup - causing very long schema generation in some cases.Closes #6467