Skip to content

[Feature][DataHub] Expose the image focal point (focalPoints) on the GraphQL Asset\Image type #492

Description

@blankse

Affected capability

DataHub

Feature description

The GraphQL Asset\Image type in pimcore/data-hub exposes no focal point. The focal point is stored on the asset as the custom settings focalPointX / focalPointY and is used by Pimcore itself for thumbnail cropping, but a GraphQL consumer (headless frontend, app, DAM integration) cannot read it and therefore cannot reproduce the same cropping client-side — it has to fall back to center crops or to a second, non-GraphQL request.

Proposal

Add a focalPoints field to the Asset\Image type:

{
  getAsset(id: 123) {
    ... on asset {
      focalPoints {
        x
        y
      }
    }
  }
}
  • x and y are Float (percentage coordinates, as stored in the custom settings).
  • The field resolves to null for non-image assets and for images without a focal point — deliberately null for the whole object rather than {x: null, y: null}, since an array of nulls would make graphql-php's default field resolver resolve each subfield on its own.

Notes

Additive, non-breaking: a new nullable field on an existing type, no change to existing fields.

Implementation is prepared in pimcore/data-hub#1010 (resolver resolveFocalPoints, covered by tests/GraphQL/Resolver/AssetTypeFocalPointsTest.php), targeting 2026.x as a new feature.

Created as the tracking issue for that PR. Note that #1010 predates the issue-link guardrail's start date (2026-07-07) and is therefore exempt from it — this issue is for traceability, not to satisfy a failing check.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Fields

Affected capability

None yet

Platform Version

None yet

Galaxy

None yet

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions