hygraph / gatsby-source-graphcms

The official Gatsby source plugin for GraphCMS projects
https://graphcms.com
MIT License
145 stars 41 forks source link

Image field not visible in gatsby GraphiQL #193

Closed meesfrenkelfrank closed 3 years ago

meesfrenkelfrank commented 3 years ago

I am using gatsby-source-graphcms and Gatsby version 3.

I created a Product model (with name, slug and image fields).

I can query the products names and slug:

query MyQuery {
  allGraphCmsProduct {
    nodes {
      name
      slug
    }
  }
}

But somehow I don't see a reference to the Image field under nodes, inside GraphiQL http://localhost:8000/___graphql?

Update: Somehow my Project.graphql Fragment was not updated? The image field which I added later was not added to inside /graphcms-fragments folder.

I re-created the Product schema in GraphCMS and now it's working.

notrab commented 3 years ago

@meesfrenkelfrank you'll need to manage those fragments in your local repo. The reason here is that you can change them to fit your Gatsby projects needs.

If you aren't making any changes to them, you could just delete the folder once you've made schema changes, and the plugin will regenerate them.