Skip to content

Add GraphQL query support for the geopolyline field type - #1157

Open
danielerne wants to merge 3 commits into
pimcore:2026.xfrom
danielerne:feat/geopolyline-query-support
Open

danielerne wants to merge 3 commits into
pimcore:2026.xfrom
danielerne:feat/geopolyline-query-support

Conversation

@danielerne

@danielerne danielerne commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Fixes pimcore/platform-version#499

Summary

  • geopolyline has been a core Pimcore object field type since 2019 (Pimcore\Model\DataObject\ClassDefinition\Data\Geopolyline), but DataHub never added a GraphQL query resolver for it - geopoint, geobounds and geopolygon are all supported, geopolyline was simply missed.
  • A geopolyline is stored identically to a geopolygon (an ordered array of GeoCoordinates), so rather than adding a duplicate generator class, the existing Geopolygon query field config generator is now tagged for both geopolygon and geopolyline - the same pattern DataHub already uses for its Input generator (tagged for externalImage/input/rgbaColor/time at once).
  • Updated the supported data types doc to list geopolyline alongside the other geo types.
  • Added a focused regression test (tests/GraphQL/DataObjectQueryFieldConfigGenerator/GeopolylineTest.php) that exercises the real ImportExportLocatorsPass compiler pass and asserts the geopolyline tag resolves to Geopolygon through the compiled service locator, and that the generator produces a list of GeopointType - container compilation alone wouldn't catch a typo'd tag id: or a wrong field type.

Test plan

  • php -l on all changed/added files
  • Verified in a downstream app that the service compiles and resolves correctly via bin/console debug:container (tagged pimcore.datahub.graphql.dataobjectquerytypegenerator, autowired, picked up by the same service locator as the other geo type generators)
  • Ran the new regression test's assertions standalone against the installed compiler pass/generator classes to confirm they pass
  • Maintainer review / CI

🤖 Generated with Claude Code

Geopolyline has been a core Pimcore object field type since 2019, but
DataHub never added a query resolver for it (unlike geopoint, geobounds
and geopolygon, which it does support). A geopolyline is stored the same
way as a geopolygon - an ordered array of GeoCoordinates - so this mirrors
the existing Geopolygon query field config generator exactly, just
registered under the geopolyline field type.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings September 18, 2026 09:04
@github-actions

github-actions Bot commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@danielerne

Copy link
Copy Markdown
Contributor Author

I have read the CLA Document and I hereby sign the CLA

@danielerne
danielerne marked this pull request as ready for review September 18, 2026 09:08

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The duplicate generator should be consolidated, with strict typing and regression coverage addressed.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Adds DataHub GraphQL query support for Pimcore’s existing geopolyline field type.

Changes:

  • Registers a geopolyline query type generator.
  • Exposes polylines as lists of geographic points.
  • Documents geopolyline query support.
File summaries
File Description
src/Resources/config/graphql.yml Registers the geopolyline generator.
src/GraphQL/DataObjectQueryFieldConfigGenerator/Geopolyline.php Defines the GraphQL field configuration.
doc/10_GraphQL/04_Query/05_DataObject_Queries.md Lists geopolyline as supported.
Review details
  • Files reviewed: 11/26 changed files
  • Comments generated: 3
  • Review effort level: Balanced

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/GraphQL/DataObjectQueryFieldConfigGenerator/Geopolyline.php Outdated
Comment thread src/GraphQL/DataObjectQueryFieldConfigGenerator/Geopolyline.php Outdated
Comment thread src/Resources/config/graphql.yml Outdated
@pimcore-deployments
pimcore-deployments marked this pull request as draft September 18, 2026 09:08
@danielerne
danielerne marked this pull request as ready for review September 18, 2026 09:25
@pimcore-deployments
pimcore-deployments marked this pull request as draft September 18, 2026 09:26
@danielerne
danielerne marked this pull request as ready for review September 18, 2026 09:26
@pimcore-deployments
pimcore-deployments marked this pull request as draft September 18, 2026 09:26
@danielerne
danielerne marked this pull request as ready for review September 18, 2026 09:29
danielerne and others added 2 commits September 18, 2026 11:31
A geopolyline is stored identically to a geopolygon (an ordered array
of GeoCoordinates), so rather than duplicating the query field config
generator class, tag the existing Geopolygon service for both field
types - the same pattern already used for e.g. the Input generator
(externalImage/input/rgbaColor/time all share one class).

Also adds a focused test exercising the real DI compiler pass
(ImportExportLocatorsPass) to confirm the geopolyline tag actually
resolves to Geopolygon through the compiled service locator, and that
the generator produces a list of GeopointType - container compilation
alone would not catch a typo'd tag id or a wrong field type.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Extract the repeated tag name and IDs into named constants so the
addTag() calls fit within the 120-character line limit.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@danielerne
danielerne force-pushed the feat/geopolyline-query-support branch from 9e6cf25 to e4a50df Compare September 18, 2026 09:31
@sonarqubecloud

Copy link
Copy Markdown

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DataHub: GraphQL query support missing for the geopolyline field type

3 participants