I have a Post
content type, which has a FeaturedImage
field. Because this field is an image upload, Strapi generates handy additional formats: thumbnail
, small
, medium
and large
.
When I query all posts in JSON, I get these formats in the response:
{
"id": 1,
"Title": "Hello World",
"Content": "Nullam id dolor id nibh ultricies vehicula ut id elit..",
"FeaturedImage": {
"id": 1,
"name": "angel-jimenez-168185",
"alternativeText": "",
"caption": "",
"width": 2768,
"height": 1560,
"formats": {
"thumbnail": {
"hash": "thumbnail_angel_jimenez_168185_aaceac7acf",
"ext": ".jpeg",
"mime": "image/jpeg",
"width": 245,
"height": 138,
"size": 6.22,
"path": null,
"url": "/uploads/thumbnail_angel_jimenez_168185_aaceac7acf.jpeg"
},
"large": {
"hash": "large_angel_jimenez_168185_aaceac7acf",
"ext": ".jpeg",
"mime": "image/jpeg",
"width": 1000,
"height": 564,
"size": 75.71,
"path": null,
"url": "/uploads/large_angel_jimenez_168185_aaceac7acf.jpeg"
},
"medium": {
"hash": "medium_angel_jimenez_168185_aaceac7acf",
"ext": ".jpeg",
"mime": "image/jpeg",
"width": 750,
"height": 423,
"size": 41.8,
"path": null,
"url": "/uploads/medium_angel_jimenez_168185_aaceac7acf.jpeg"
},
"small": {
"hash": "small_angel_jimenez_168185_aaceac7acf",
"ext": ".jpeg",
"mime": "image/jpeg",
"width": 500,
"height": 282,
"size": 19.69,
"path": null,
"url": "/uploads/small_angel_jimenez_168185_aaceac7acf.jpeg"
}
}
}
}
However, if I query in GraphQL, only the publicURL
for the original (full size) image is available:
How I access these image formats with GraphQL?