gatsby-source-sanity
gatsby-source-sanity copied to clipboard
'maxWidth' does not exist on type GatsbyImageDataArgs
In the documentation for using the new gatsby-plugin-image
with gatsby-source-sanity
, the example shows an implementation of getGatsbyImageData
and passes in an object with a maxWidth
set.
Example here: https://www.gatsbyjs.com/plugins/gatsby-source-sanity/#using-images
In reality, the GatsbyImageDataArgs
type does not have a maxWidth property available:
export declare type GatsbyImageDataArgs = {
width?: number;
height?: number;
aspectRatio?: number;
layout?: Layout;
sizes?: string;
placeholder?: 'blurred' | 'dominantColor' | 'none';
fit?: ImageFit;
};
So it seems the documentation is incorrect.
The real bummer is that it appears maxWidth
queries are no longer supported like they used to be. Previously, you could do a fluid query with a maxWidth set in Graphql to limit the size of the retrieved image. Now a hard set width is required.
Does this width
function in the same way that maxWidth used to?
Same issue here.
Same issue here :/
Same issue here...
Same issue here...
@evenwestvang Is anyone at Sanity aware of this issue? This has been open for over a year and is a quite fundamental problem.