GraphQL Integration

Created on 8 October 2018, about 6 years ago
Updated 9 June 2023, over 1 year 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

1.0

Component

Code

Created by

🇨🇭Switzerland das-peter

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

Merge Requests

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.71.5 2024