Add missing DocumentElementType Renderlet#1005
Conversation
|
|
Adds a RenderletType GraphQL type and its query field config generator, modeled on the existing RelationsType, exposing the editable's _editableType/_editableName/id/type/subtype and its single relation target. Registers the generator service and baselines the new static() usage. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Extract a resolveRenderlet() helper for the simple editable fields so the repeated instanceof checks no longer live inside getInstance(), reducing its cognitive complexity below the threshold. Drop the unused resolver parameters from those fields and wrap the relation resolver signature to stay within the line-length limit. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
|
@kingjia90 Can you review this also please? |
There was a problem hiding this comment.
Pull request overview
This PR adds GraphQL query support for the Pimcore "Renderlet" document editable, which was previously the only document element type missing a GraphQL type. It introduces a new RenderletType (exposing _editableType, _editableName, id, type, subtype, and the referenced relation resolved as an anytarget element), a matching Renderlet field-config generator, and wires them up via service configuration. The remainder of the diff is a regenerated studio frontend build (new hash directory 64084715… replacing 785fd5b2…).
Changes:
- New
RenderletTypeGraphQL object type, mirroring the existingRelationType(usesgetO()for the relation target instead ofgetElement()). - New
Renderletquery field config generator + service registration ingraphql.yml, and a phpstan-baseline entry for thenew static()usage. - Regenerated studio build artifacts and a refreshed
manifest/publicPathhash.
Reviewed changes
Copilot reviewed 12 out of 27 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/GraphQL/DocumentElementType/RenderletType.php | New GraphQL type exposing Renderlet fields and relation |
| src/GraphQL/DocumentElementQueryFieldConfigGenerator/Renderlet.php | New generator returning RenderletType, consistent with siblings |
| src/Resources/config/graphql.yml | Registers the Renderlet type generator service |
| phpstan-baseline.neon | Baselines the new static() warning for RenderletType |
| src/Resources/public/studio/build/64084715.../* | Regenerated studio frontend build artifacts (new hash dir) |
| src/Resources/public/studio/build/785fd5b2.../* | Removed previous studio build artifacts |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.







Adds GraphQL support for the Renderlet document editable, which was previously missing from the document element types.
Introduces a new RenderletType exposing the editable's _editableType, _editableName, id, type, subtype and the referenced relation (resolved as an anytarget element), plus the corresponding Renderlet query field config generator and its service registration.