Graph API search Sharepoint for images returns DispForm instead of the image
I am trying to search my Sharepoint site and get a list of images that match a search term eg if I have https://example.sharepoint.com/sites/photos
And my query is:
{
requests: [
{
entityTypes: ['listItem'],
query: { queryString: 'Filetype:png' },
},
],
}
The results that come back are for "DispForm.aspx", not for the actual image. But DispForm does include the image details.
This happens when searching for listItem or driveItem - both have the same problem.
Results json: - every hit is a link to DispForm
{
hitId: '...',
rank: 1,
resource: {
@odata.type: "#microsoft.graph.listItem",
webUrl: "
}
}
And the DispForm does actually show the image details:
Name
photo.png
Title
Enter value here
Image Tags
stuff
Descriptions
Enter value here
Why? How do I get the search to return the image itself and not DispForm?
What I want to get instead is the webUrl to the actual image.