Implement a data producer for image derivatives

Created on 29 March 2023, over 1 year ago
Updated 25 January 2024, 10 months ago

Problem/Motivation

We are currently using image derivatives in graphql v3. We could not find a way to use derivatives in graphql_core_schema. Is this possible with today's version? If not, what would be necessary to make it work?
We depend on derivatives in our environment and it is important for us to get this feature with graphql_core_schema - If it is not yet supported, we would like to try to implement the feature inside graphql_core_schema and contribute the code.

Apart from derivatives, we have not encountered any problems with graphql_core_schema so far. Thanks for the great work!

💬 Support request
Status

Fixed

Version

1.0

Component

Code

Created by

🇩🇪Germany philipp.krauss

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @philipp.krauss
  • Status changed to Needs work over 1 year ago
  • 🇨🇭Switzerland ayalon

    You can easily extend this feature in an extension inside this module.

    We are using https://www.drupal.org/project/rokka as an image CDN and do not rely on image derivatives from Drupal.

    All you need to to is to add an extension and a data producer that allows the image styles to be used as "enums" and generate the links.
    Most of the code could be easily taken from the GraphQL 3 module.

    Currently this feature is not high on our priority list but we highly appreciate your contribution as a patch or merge request.

  • 🇨🇭Switzerland dulnan

    I have implemented a new "Image" extension that adds a derivative field. It works pretty much like in graphql v3:

    query {
      entityById(entityType: MEDIA, id: "3") {
        ... on MediaImage {
          fieldImage {
            hero: derivative(style: HERO) {
              urlPath
              width
              height
            }
            thumbnail: derivative(style: THUMBNAIL) {
              urlPath
              width
              height
            }
          }
        }
      }
    }
    

    The new extension is available on the dev branch.

  • 🇨🇳China skyredwang Shanghai

    Can you please tag a new beta release?

  • Thank you for your work here! We just integrated the extension in our dev setup and it works as expected.
    Is there any timeline for when this change will be included in a version tag?
    Are there any steps we could help with to release this extension?

  • 🇨🇭Switzerland dulnan

    I've created a new release that includes the new image extension.

  • Status changed to Fixed 10 months ago
  • Status changed to Fixed 10 months ago
Production build 0.71.5 2024