I have a fairly simple Gatsby & Netlify CMS site. I can't cope with making images optional. In case of Netlify CMS it's just a matter of setting one field required: false
. How do I write a query for Gatsby so I don't get an error 'GraphQL Error Field "image" must not have a selection since type "String" has no subfields.' when the image is in fact an empty string since it's not mandatory in my app? Is there any way around this?
GraphQL query for image:
image {
childImageSharp {
fluid(maxWidth: 2048)
...GatsbyImageSharpFluid
}
}
}