-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
[v2][gatsby-transformer-json] Querying images with relative path result in null
#6367
Comments
Hmm what happens if you have only one instance of gatsby-source-filesystem that's pointed at "src"? This shouldn't matter but perhaps theres a bug. Also, can you verify that you can query "allFile" and see both files? |
It seems that So instead of: {
resolve: `gatsby-source-filesystem`,
options: {
name: `content`,
path: `./src/content`,
},
}, use: {
resolve: `gatsby-source-filesystem`,
options: {
name: `content`,
path: `${__dirname}/src/content`,
},
}, Read the docs, I guess. 🤦♂️ |
Damn, I did exactly the same thing and it took me days to work out why it was silently failing. Nice work @fabe |
Description
I'm trying to use
gatsby-image
withgatsby-transformer-json
by querying an image via its relative path:content/index.json
The image is successfully found and the GraphQL schema sees
image
as a typeFile
, including thechildImageSharp
. However, when using GraphiQL and trying to access any property,image
always returnsnull
without errors.Steps to reproduce
Example repo: https://github.com/fabe/test-gatsby-json-image
Use GraphiQL to query the image specified in the JSON content file.
Environment
The text was updated successfully, but these errors were encountered: