Skip to content
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

GraphQL Error Field must not have a selection since type "String" has no subfields. #2

Closed
BCOA opened this issue Jun 11, 2018 · 7 comments · Fixed by #3
Closed

GraphQL Error Field must not have a selection since type "String" has no subfields. #2

BCOA opened this issue Jun 11, 2018 · 7 comments · Fixed by #3

Comments

@BCOA
Copy link

BCOA commented Jun 11, 2018

Daniel, Thanks for your work on this module! I've been trying to get this setup over this weekend and just keep coming up against this error no matter what I have tried. This is undoubtedly user error on my end but I was hoping you might give a quick eye to my problem. Maybe you will see something quickly that I'm just missing.

https://github.com/BCOA/bcoa.com/blob/relativeImages/gatsby-node.js
https://github.com/BCOA/bcoa.com/blob/relativeImages/gatsby-config.js
Page / Collection Query: https://github.com/BCOA/bcoa.com/blob/relativeImages/src/templates/news.js#L100-L109
Test Data: https://github.com/BCOA/bcoa.com/blob/relativeImages/src/pages/articles/test.md

I come across this error in GraphiQL and when I run gatsby-develop

Any help would be appreciated!

@axelboc
Copy link
Contributor

axelboc commented Jun 13, 2018

Are you on Windows? If so, PR #3 should fix your problem. If not, it could also be something to do with your Netlify CMS configuration - cf. #4.

@joshuarule
Copy link

joshuarule commented Jun 13, 2018

@axelboc i'm not on windows.

This is how i'm setup so would that not be correct based on #4 ?

media_folder: "static/images/uploads"
public_folder: "/images/uploads"

@danielmahon
Copy link
Owner

@BCOA looking at this now

@danielmahon danielmahon reopened this Jun 13, 2018
@danielmahon
Copy link
Owner

@BCOA @axelboc @joshuarule Can you all see if the changes in the latest master f94bf4b, fix your issues?... Thank you!

@joshuarule
Copy link

joshuarule commented Jun 14, 2018

Awesome! So now it's reading the images as files which is great but I'm probably holding something wrong on the front end.

With gatsby-image i'm doing this below but getting TypeError: Cannot read property 'src' of undefined Do you have a suggestion about how to work with gatsby-image or something else?

image {
  childImageSharp {
    sizes(maxWidth: 1240 ) {
      ...GatsbyImageSharpSizes_tracedSVG
    }
  }
}
// using gatsby-image
<Img sizes={image.sizes} /> }

@danielmahon
Copy link
Owner

danielmahon commented Jun 14, 2018

@joshuarule looks like you’re missing childImageSharp, try setting sizes to image.childImageSharp.sizes.

@joshuarule
Copy link

@danielmahon Ahh yes! Works perfectly now. Thanks so much for the help. This issue was really stressing me out for about a week so it's really great to see it working now. Also I originally posted from @BCOA so you can close this ticket!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants