A space to discuss GraphQL queries, mutations, troubleshooting, throttling, and best practices.
{ files(sortKey: CREATED_AT, reverse: true, first: 12, query: "media_type:video OR media_type:image AND -status:FAILED") { edges { node { __typename fileStatus preview { status image { width height src url(transform: {maxWidth: 300, maxHeight: 300, preferredContentType: PNG}) } } ... on GenericFile { id url } ... on MediaImage { id image { src } } ... on Video { id filename sources { fileSize format height width mimeType url } } } cursor } pageInfo { hasNextPage } } }
Internal error. Looks like something went wrong on our end.
Request ID: be66bd1a-06aa-4af9-acb2-472ffb749cd5 (include this in support requests).
Solved! Go to the solution
This is an accepted solution.
Hi @DanAtBonify 👋
Thanks for sharing the request ID! Would you mind checking whether your app has the `read_files` scope using the below query?
{
currentAppInstallation {
accessScopes {
handle
}
}
}
I've seen similar behaviours with the `reverse` param on interface types since there may be an additional scope required for the returned object. In this case, I suspect it's the `GenericFile` type causing the issue. You should be able to check it with the below, if it throws a similar 500 error:
query {
files (first:3, query: "media_type:generic_file"){
nodes {
__typename
}
}
}
Developer Support @ Shopify
- Was this reply helpful? Click Like to let us know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog
This is an accepted solution.
Hi @DanAtBonify 👋
Thanks for sharing the request ID! Would you mind checking whether your app has the `read_files` scope using the below query?
{
currentAppInstallation {
accessScopes {
handle
}
}
}
I've seen similar behaviours with the `reverse` param on interface types since there may be an additional scope required for the returned object. In this case, I suspect it's the `GenericFile` type causing the issue. You should be able to check it with the below, if it throws a similar 500 error:
query {
files (first:3, query: "media_type:generic_file"){
nodes {
__typename
}
}
}
Developer Support @ Shopify
- Was this reply helpful? Click Like to let us know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog
Thank you!
Yes, indeed the read_files scope was missing. It was confusing because apparently some file types don't need that permission, so they load correctly.
Also made confusing by the error message. I would expect a more specific error message referring to the specific missing scope.
Absolutely, the error message should be clearer. I'll submit an issue to adjust the error to reference the missing scope instead. Thanks for flagging this!
Developer Support @ Shopify
- Was this reply helpful? Click Like to let us know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog