Repository navigation
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Makes getDocument(fullpath) resolve document folders correctly.
Changes:
- Adds
_document_folderto thedocumentunion. - Resolves
Document\Folderinstances to that type.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
blankse
added a commit
to blankse/data-hub
that referenced
this pull request
Jul 20, 2026
Adding _document_folder to the document union made it appear twice in AnyDocumentTargetType/AnyTargetType, which prepend it and then merge the document union's types. GraphQL unions require unique members. Rely on the document union as the single source: AnyDocumentTargetType returns its types directly; AnyTargetType only adds _document_folder separately when the document union itself is not merged.
blankse
added a commit
to blankse/data-hub
that referenced
this pull request
Jul 22, 2026
Adding _document_folder to the document union made it appear twice in AnyDocumentTargetType/AnyTargetType, which prepend it and then merge the document union's types. GraphQL unions require unique members. Rely on the document union as the single source: AnyDocumentTargetType returns its types directly; AnyTargetType only adds _document_folder separately when the document union itself is not merged.
blankse
force-pushed
the
document-union-folder-safe
branch
from
July 22, 2026 17:16
68eb0ed to
51fe9e4
Compare
|
blankse
force-pushed
the
document-union-folder-safe
branch
from
September 7, 2026 11:23
fce982c to
5b238cc
Compare
blankse
added a commit
to blankse/data-hub
that referenced
this pull request
Sep 7, 2026
Adding _document_folder to the document union made it appear twice in AnyDocumentTargetType/AnyTargetType, which prepend it and then merge the document union's types. GraphQL unions require unique members. Rely on the document union as the single source: AnyDocumentTargetType returns its types directly; AnyTargetType only adds _document_folder separately when the document union itself is not merged.
pimcore-deployments
marked this pull request as draft
September 7, 2026 11:23
Contributor
Author
|
@robertSt7 Can you review this? |
blankse
added a commit
to blankse/data-hub
that referenced
this pull request
Sep 7, 2026
Covers both halves of the fix: DocumentType::getTypes() lists '_document_folder' as a possible type of the 'document' union and DocumentType::resolveType() resolves a document folder to it (without it getDocument() on a folder path fails with "Abstract type Document must resolve to an Object type at runtime"). Also covers the dedupe: the composed unions AnyDocumentTargetType and AnyTargetType contain '_document_folder' exactly once when the document union is enabled, and AnyTargetType still contains it when the document union is disabled. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
blankse
added a commit
to blankse/data-hub
that referenced
this pull request
Sep 7, 2026
Covers both halves of the fix: DocumentType::getTypes() lists the folder type as a possible type of the 'document' union and DocumentType::resolveType() resolves a document folder to it (without it getDocument() on a folder path fails with "Abstract type Document must resolve to an Object type at runtime"). Also covers the dedupe: the composed unions AnyDocumentTargetType and AnyTargetType contain the folder type exactly once when the document union is enabled, and AnyTargetType still contains it when the document union is disabled. The union members are compared by GraphQL type name: the container inlines the tagged type services, so the same type can be a different PHP instance depending on where it is taken from. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
blankse
force-pushed
the
document-union-folder-safe
branch
from
September 7, 2026 13:39
a1f4dab to
cfc4e80
Compare
blankse
marked this pull request as ready for review
September 16, 2026 07:16
…oring The 'document' union's resolveType returned null for folders, causing getDocument(fullpath) on a folder path to fail with an unresolvable abstract type. Add the existing _document_folder type to the union and resolve it, mirroring the folder guard already used in the relation resolvers (AbstractRelationsType, ObjectsType, AnyDocumentTargetType). (cherry picked from commit e2d50d4)
Adding _document_folder to the document union made it appear twice in AnyDocumentTargetType/AnyTargetType, which prepend it and then merge the document union's types. GraphQL unions require unique members. Rely on the document union as the single source: AnyDocumentTargetType returns its types directly; AnyTargetType only adds _document_folder separately when the document union itself is not merged. (cherry picked from commit 5b238cc)
Covers both halves of the fix: DocumentType::getTypes() lists the folder type as a possible type of the 'document' union and DocumentType::resolveType() resolves a document folder to it (without it getDocument() on a folder path fails with "Abstract type Document must resolve to an Object type at runtime"). Also covers the dedupe: the composed unions AnyDocumentTargetType and AnyTargetType contain the folder type exactly once when the document union is enabled, and AnyTargetType still contains it when the document union is disabled. The union members are compared by GraphQL type name: the container inlines the tagged type services, so the same type can be a different PHP instance depending on where it is taken from. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> (cherry picked from commit cfc4e80)
jcPimcore
force-pushed
the
document-union-folder-safe
branch
from
September 24, 2026 13:59
cfc4e80 to
76d0d0d
Compare
|
45 of 74 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



getDocument(fullpath)on a folder path currently fails:DocumentType::resolveTypereturnsnullfor folders, so thedocumentunion cannot resolve the abstract type at runtime ("Abstract type Document must resolve to an Object type at runtime ... received null").This adds the already-existing
_document_foldertype to the union (getTypes) and resolves it (resolveType), mirroring the folder guard already present inAbstractRelationsType,ObjectsTypeandAnyDocumentTargetType. No new type is introduced.Verified against a real Pimcore install: before,
getDocumenton a folder path errors; after, it returnsdocument_folder. Non-folder documents are unaffected.Related
Fixes pimcore/platform-version#491
Builds on the
resolveType()folder guards merged with #1105. Those guards make a document folder resolve to_document_folder; this PR makes_document_folderan actual member of thedocumentunion, so the resolved type is a valid possible type. Both halves are needed for the document-folder case — with #1105 merged, this is the remaining one.Since
AbstractRelationsType::getTypes()andPropertyType\ObjectsType::getTypes()merge the types of thedocumentunion, the folder-inclusive union propagates to relations and properties automatically; no additional change is needed there (analogous to the object-folder handling in #1054).Rebased onto 2026.2 after #1105 and #1054 were merged. The previous
Automatic frontend buildcommit was dropped so the build folder matches the base branch.