Closed engmagdy87 closed 5 years ago
I'm tying to query uploaded image using graphql in gatsby, but the query fails Field "logo" must not have a selection since type "String" has no subfields.
this is gatsby-config.js gist
this is config.yml gist
and this is md file
and this is the query
query PartnersQuery { allMarkdownRemark(filter: {frontmatter: {section: {eq: "partners"}}}) { edges { node { id frontmatter { title logo { childImageSharp { fluid(maxWidth: 700) { srcSet sizes aspectRatio src } } } } } } } }
solved by adding this snippet to gatsby-node.js
const { fmImagesToRelative } = require('gatsby-remark-relative-images'); exports.onCreateNode = ({ node }) => { fmImagesToRelative(node); };
I'm tying to query uploaded image using graphql in gatsby, but the query fails Field "logo" must not have a selection since type "String" has no subfields.
this is gatsby-config.js gist
this is config.yml gist
and this is md file
section: partners title: bolt logo: /uploads/logo.png
and this is the query