GraphQL Integration

Created on 8 October 2018, over 5 years ago
Updated 9 November 2023, 8 months ago

Problem/Motivation

Would be nice if we could integrate this module a bit deeper into the GraphQL β†’ Module.
Currently if you use a derivative query like this:

query {
  entity:route(path: "/node/1") {
    ... on EntityCanonicalUrl {
      entity {
        entityTranslation(language: DE) {
	  ... on NodeArticle {
            entityLabel
            fieldImage {
              derivative(style: THUMBNAIL) {
                url
              }
            }
       	  }
        }
      }
    }
  }
}

You'll get a url like this: https://example.org/sites/default/files/styles/[IMAGE_STYLE]/public/2018-07/column-3.svg?itok=mhE3EI_r but often all you need / can have is https://example.org/sites/default/files/2018-07/column-3.svg.

Proposed resolution

The attached patch extends the existing ImageDerivative handler from GraphQL to differ between SVG and other files.

Currently it provides its own function svg_derivative and also hijacks the default derivative function.
We might want to make the hijacking optional.

Remaining tasks

Reviews needed.
Decide if we'd like to make the hijacking of the default derivative function configurable.

User interface changes

None.

API changes

None.

Data model changes

None.

✨ Feature request
Status

Needs review

Version

3.0

Component

Code

Created by

πŸ‡¨πŸ‡­Switzerland das-peter

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024