GraphQL: Filter and OrderBy for field types (not only record types)

I have had a similar issue to this one here:
https://community.datocms.com/t/get-limited-number-of-images-from-gallery-field/

I have an asset field (FileField) which stores multiple assets, but in the GraphQL query I only want to retrieve the first value and sort by the meta fields “title” or “alt”.

However it seems filter or orderBy are only supported on Record types and not field types. Like the nested filter below on “images” is not supported. I know this works with other GraphQL implementations like Dgraph.io, so it would fantastic to see this here too.

allArtists(filter: {...}){
  name
  ...
  images(filter: {first: 1}) {
    responsiveImage {
        ...RESPONSIVE_IMAGE_FRAGMENT
    }
  }
}

My current workaround is a computed field.

If I’d start from scratch I’d probably try the alternative of creating a new Model for “Multiple Files” instead of using the Multiple assets field and link to this.


Actually is this a duplicate of this feature request?