Search files by ALT text and filter empty

The Files section was a really great implementation, but we are really missing a way to filter files by ALT text or filter out empty ALT texts.

This would allow merchants to quickly fill in all missing ALT texts in their files section or find specific files based on ALT text which is more descriptive.

Is this available on the GQL API by any chance ?

Hey @elilip! The files query doesn’t support filtering by alt text. The available filters are filename, media_type, status, created_at, updated_at, original_upload_size, product_id, and used_in.

The workaround would be to paginate through files via the API and filter client-side:

query {
  files(first: 50, query: "media_type:IMAGE") {
    edges {
      node {
        ... on MediaImage {
          id
          alt
          image { url }
        }
      }
    }
    pageInfo { hasNextPage endCursor }
  }
}

Check each node’s alt for null/empty and paginate with after. Not ideal for large libraries but should get you there!