I’m currently using the files API (https://shopify.dev/docs/api/admin-graphql/2024-01/queries/files) to query image information. It works well, but when I follow the demo and add originalFileSize, it prompts: GraphqlQueryError: Field 'originalFileSize' doesn't exist on type 'MediaImage'. I really need this field, so I’ve been trying to resolve this issue but without success. The demo in the documentation shows how to query this field, but I haven’t been successful. Could it be a problem with my code, or is there an issue with the demo code in the documentation?
My api_version is “2024-01”, and my code is as follows:
const response = await admin.graphql(
`#graphql
query {
files(${pageSize}, query:"${condition}" ${pageCondition} reverse:true) {
edges {
node {
createdAt
updatedAt
alt
... on MediaImage {
id
originalFileSize
image {
originalSrc: url
width
height
}
}
}
}
pageInfo {
hasNextPage
endCursor
hasPreviousPage
startCursor
}
}
}`
);