I'm trying to source images from Sanity with gatsby-source-sanity
and gatsby-image
. In the past I've had no issue querying the fluid
image asset like so:
export const query = graphql`
query {
allSanityPicture {
nodes {
image {
asset {
fluid(maxWidth: 900) {
...GatsbySanityImageFluid
}
}
}
}
}
}
`;
However, for some reason the fluid
and fixed
fields of asset
aren't showing up in GraphQL:
There's definitely an image on the node, as the url
field works.
I've installed and configured my Gatsby plugins as required:
plugins: [
{
resolve: `gatsby-source-sanity`,
options: {
projectId: `mhlt1wid`,
dataset: `production`,
token: process.env.SANITY_TOKEN,
}
},
`gatsby-plugin-sharp`,
`gatsby-transformer-sharp`,
],
and deployed the GraphQL API with sanity graphql deploy
.
What am I missing here? Have tried from scratch twice now on two fresh projects and still having the same issue.