Fix relations/properties pointing to document folders - #1105
Conversation
1697967 to
72cc832
Compare
|
1 similar comment
|
There was a problem hiding this comment.
Pull request overview
Fixes GraphQL type resolution for document-folder relation and property targets. The PR also includes two competing generated Studio builds, unrelated to the stated fix.
Changes:
- Maps document folders to
_document_folderin four resolvers. - Adds two Studio build artifact sets and removes legacy manifests.
- Updates generated public paths and entrypoints.
Reviewed changes
Copilot reviewed 26 out of 48 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
src/GraphQL/DataObjectType/AbstractRelationsType.php |
Resolves relation document folders. |
src/GraphQL/General/AnyTargetType.php |
Resolves generic document-folder targets. |
src/GraphQL/General/AnyDocumentTargetType.php |
Resolves document-only folder targets. |
src/GraphQL/PropertyType/ObjectsType.php |
Resolves property document folders. |
.../987f95c1.../static/js/remoteEntry.js.LICENSE.txt |
Adds generated license notices. |
.../987f95c1.../static/js/main.9c3ad8a2.js.LICENSE.txt |
Adds generated license notice. |
.../987f95c1.../static/js/async/840.4693a4bb.js.LICENSE.txt |
Adds dependency licenses. |
.../987f95c1.../static/js/async/696.3b1d6da3.js.LICENSE.txt |
Adds generated license notice. |
.../987f95c1.../static/js/async/696.3b1d6da3.js |
Adds compiled Studio chunk. |
.../987f95c1.../static/js/async/__federation_expose_plugins.c4cf01bd.js.LICENSE.txt |
Adds generated license notice. |
.../987f95c1.../static/js/async/__federation_expose_plugins.c4cf01bd.js |
Adds compiled plugin exposure. |
.../987f95c1.../static/js/async/__federation_expose_default_export.87553f32.js.LICENSE.txt |
Adds generated license notice. |
.../987f95c1.../static/js/async/__federation_expose_default_export.87553f32.js |
Adds compiled SDK exposure. |
.../987f95c1.../static/js/109.62a4c31b.js.LICENSE.txt |
Adds generated license notices. |
.../987f95c1.../mf-stats.json |
Updates generated public path. |
.../987f95c1.../mf-manifest.json |
Updates generated public path. |
.../987f95c1.../manifest.json |
Adds build manifest. |
.../987f95c1.../main.html |
Adds generated HTML entry. |
.../987f95c1.../exposeRemote.js |
Registers the generated remote. |
.../987f95c1.../entrypoints.json |
Adds build entrypoints. |
.../785fd5b2.../manifest.json |
Removes legacy build manifest. |
.../785fd5b2.../entrypoints.json |
Removes legacy entrypoints. |
.../04ab6b52.../static/js/remoteEntry.js.LICENSE.txt |
Adds generated license notices. |
.../04ab6b52.../static/js/main.9c3ad8a2.js.LICENSE.txt |
Adds generated license notice. |
.../04ab6b52.../static/js/async/840.b584be96.js.LICENSE.txt |
Adds dependency licenses. |
.../04ab6b52.../static/js/async/499.4aead98c.js.LICENSE.txt |
Adds generated license notice. |
.../04ab6b52.../static/js/async/499.4aead98c.js |
Adds compiled Studio chunk. |
.../04ab6b52.../static/js/async/__federation_expose_plugins.85a68c1a.js.LICENSE.txt |
Adds generated license notice. |
.../04ab6b52.../static/js/async/__federation_expose_default_export.062d3a0b.js.LICENSE.txt |
Adds generated license notice. |
.../04ab6b52.../static/js/async/__federation_expose_default_export.062d3a0b.js |
Adds compiled SDK exposure. |
.../04ab6b52.../static/js/109.62a4c31b.js.LICENSE.txt |
Adds generated license notices. |
.../04ab6b52.../mf-stats.json |
Adds federation build statistics. |
.../04ab6b52.../mf-manifest.json |
Adds federation manifest. |
.../04ab6b52.../manifest.json |
Adds build manifest. |
.../04ab6b52.../main.html |
Updates generated script paths. |
.../04ab6b52.../exposeRemote.js |
Updates remote registration path. |
.../04ab6b52.../entrypoints.json |
Adds competing build entrypoints. |
Files not reviewed (3)
- src/Resources/public/studio/build/04ab6b52-dfd5-4e8c-9d1e-8e789ac66855/static/js/async/499.4aead98c.js: Generated file
- src/Resources/public/studio/build/04ab6b52-dfd5-4e8c-9d1e-8e789ac66855/static/js/async/__federation_expose_default_export.062d3a0b.js: Generated file
- src/Resources/public/studio/build/04ab6b52-dfd5-4e8c-9d1e-8e789ac66855/static/js/async/__federation_expose_plugins.85a68c1a.js: Generated file
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
All document types have type and properties fields, but the relation type resolvers did not handle folders, pointing them to a non-existing 'document_folder' type definition instead of the registered '_document_folder'. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
fe6c60d to
8b2619f
Compare
6b8034b to
2273097
Compare
f43acf4 to
2273097
Compare
|
@blankse Could you please add a regression test for this fix? |
|
@blankse ping |
Covers all four resolvers touched by this fix (AbstractRelationsType via HrefType, PropertyType\ObjectsType, AnyTargetType, AnyDocumentTargetType): a relation/property/hotspot metadata value pointing at a document folder resolves to the '_document_folder' type, while a page still resolves to 'document_page'. Without the fix the folder case looked up 'document_folder' and threw "unknown document type". Service::getDocumentDataTypes() is added as the counterpart of the existing getDataObjectDataTypes() so the test can restore the registered document types after temporarily registering its own.
|
Added in f1b9205: It creates a real Two notes:
|
|
|
@blankse Thanks for fixing this pointing |



Bug
When a relation, an object/document property or an editable relation targets a document folder, the GraphQL query fails with:
The
resolveType()methods of the relation/property resolvers handle thedocumentelement type viagetDocumentTypeDefinition('document_' . $documentType). For a folder, $documentType isfolder→document_folder, which is not a registered type (only_document_folderis). This makes any query that can resolve a document folder through such a field error out.Fix
Add a folder guard that returns the registered
_document_foldertype — mirroring how object folders are already handled (_object_folder).Affected resolvers:
src/GraphQL/DataObjectType/AbstractRelationsType.phpsrc/GraphQL/General/AnyTargetType.phpsrc/GraphQL/General/AnyDocumentTargetType.phpsrc/GraphQL/PropertyType/ObjectsType.phpNotes
Analogous to the object-folder fix.
php -lclean on all four files.Related
Complementary to #1126. This PR only adds the
resolveType()folder guard (so a folder value resolves to_document_folder). For that resolved type to be a valid member of the relation/property unions, it also needs #1126, which makes thedocumentunion folder-inclusive. Both are required for relations/properties targeting a document folder — please merge together.