-
Notifications
You must be signed in to change notification settings - Fork 18
Open
Description
Plugin version: 5.0.0
Craft CMS version: 5.8.22
PHP version: 8.2
Problem
When querying a LinkIt field inside a Matrix block via GraphQL, the field resolves incorrectly:
- The LinkIt field itself (contactDetails) resolves to an object
- All subfields (link, url, label, type, etc.) return null
- In some cases, the resolver receives an empty craft\elements\ElementCollection instead of a presseddigital\linkit\base\Link model
The same LinkIt field works correctly outside of Matrix and works fine in Twig.
Expected Behavior
A LinkIt field inside a Matrix block should resolve via GraphQL the same way it does on an Entry:
contactDetails {
link
url
label
type
typeHandle
text
}…returning the actual link values.
Actual Behavior
GQL Response
{
"contactDetails": {
"link": null,
"label": null,
"url": null,
"typeHandle": null,
"type": null,
"text": null
}
}In debugging, the GraphQL resolver often receives:
craft\elements\ElementCollection {
items: []
}instead of a presseddigital\linkit\base\Link instance.
Reproducing Steps
- Create a Matrix field with a block type containing a LinkIt field
- Add content to that LinkIt field
- Query via GraphQL:
{
entries(section: "officeLocations") {
... on officeLocations_Entry {
contactLinks {
... on contactLink_Entry {
contactDetails {
link
label
url
type
typeHandle
text
}
}
}
}
}
}- Observe that all contactDetails subfields return null
Metadata
Metadata
Assignees
Labels
No labels