Field must not have a selection since type "String" has no subfields.
See original GitHub issueThere was an error in your GraphQL query:
Field “headerImage” must not have a selection since type “String” has no subfields.
This can happen if you e.g. accidentally added { } to the field “headerImage”. If you didn’t expect “headerImage” to be of type “String” make sure that your input source and/or plugin is correct.
gatsby-config.js 👇🏻
plugins: [
"gatsby-plugin-sharp",
"gatsby-transformer-sharp",
{
resolve: "gatsby-transformer-remark",
options: {
plugins: [
"gatsby-remark-relative-images",
{
resolve: "gatsby-remark-images",
options: {
maxWidth: 750,
linkImagesToOriginal: false,
},
},
],
},
},
"gatsby-plugin-react-helmet",
{
resolve: "gatsby-source-filesystem",
options: {
name: "images",
path: `${__dirname}/src/images`,
},
},
{
resolve: "gatsby-source-filesystem",
options: {
name: "src",
path: `${__dirname}/src/`,
},
},
.md 👇🏻
pluginName: Unsplash
pluginLogo: ../images/unsplash_logo.jpeg
headerImage: ../images/unsplash_header.jpeg
creatorName: Unsplash
creatorImage: ../images/unsplash_creator.png
pluginLink: https://www.figma.com/community/plugin/738454987945972471/Unsplash
query👇🏻
query($slug: String!) {
markdownRemark(fields: { slug: { eq: $slug } }) {
html
frontmatter {
pluginName
headerImage {
childImageSharp {
fluid(maxWidth: 340) {
...GatsbyImageSharpFluid
}
}
}
}
}
}
P.S. did go through similar issues. did not help…
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
How to work around GraphQL error, field "x" must not have a ...
Field "url" must not have a selection since type "String" has no subfields. Does anyone have any suggestions on how to work around...
Read more >Field \"songs\" must not have a selection since type \"[String ...
\" has no subfields. I'm getting the above error when doing a query on GraphQL. I ...
Read more >Troubleshooting Common Errors - Gatsby
This error message Field "image" must not have a selection since type "String" has no subfields. comes up when a GraphQL query is...
Read more >Validation - GraphQL
That type does not have a favoriteSpaceship field, so this query is invalid: ... "message": "Field \"name\" must not have a selection since...
Read more >“Field “image” must not have a selection since type “String ...
Error: “Field “image” must not have a selection since type “String” has no subfields." · Reconfigure the gatsby-config so that plugin-sharp and ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Fixed it! Thanks.
In my case I just had to remove unneeded square brackets in my request