Skip to content

[Bug][DataHub] getDocument on a document folder fails: "Abstract type Document must resolve to an Object type at runtime" #491

Description

@blankse

Affected Version

2026.2

Affected capability

DataHub

Steps to reproduce

  1. Pimcore 2026.2 with pimcore/data-hub, a GraphQL endpoint configured with the Document schema enabled.
  2. Create a document folder, e.g. /shared.
  3. Query that folder by its full path:
{
  getDocument(fullpath: "/shared") {
    ... on document_folder {
      id
      fullpath
    }
  }
}

The same happens whenever a document folder is reached through a relation, a document/object property or an editable relation (AnyDocumentTarget / AnyTarget).

Actual Behavior

The query fails at runtime:

Abstract type Document must resolve to an Object type at runtime for field Query.getDocument ... received null

DocumentType::resolveType() has no branch for Document\Folder and returns null, and _document_folder — although it is a registered type — is not a member of the document union returned by DocumentType::getTypes(). So the union can neither resolve nor accept a document folder.

For object folders the equivalent case already works (_object_folder); only documents are affected.

Expected Behavior

getDocument() on a folder path returns the folder as document_folder, and document folders reached through relations/properties resolve to the registered _document_folder type. Non-folder documents stay unaffected.

Additional notes

Fix is prepared in pimcore/data-hub#1126 (adds _document_folder to the document union and resolves Document\Folder to it; includes a regression test). It complements the resolveType() folder guards merged with pimcore/data-hub#1105 — both halves are needed for the document-folder case.

This issue is created as the tracking issue required by the issue-link guardrail for that PR.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    Affected capability

    DataHub

    Platform Version

    2026.2

    Galaxy

    None yet

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions