- Issue created by @das-peter
- 🇨🇭Switzerland das-peter
Integration added.
Before the integration one could execute the referenced view like this:query ViewsReferenceFieldDemo { entityById(entityType: PARAGRAPH, id: 110) { ... on ParagraphViewsReferenceFieldDemo { bpViewRawField { first { entity { executable(displayId: "block_1") { execute { rows { __typename id label } } } } } } } } }
The change keeps this behavior untouched - but you can now use the following query to execute the view with viewsreference pre-configured:
query ViewsReferenceFieldDemo { entityById(entityType: PARAGRAPH, id: 110) { ... on ParagraphViewsReferenceFieldDemo { bpViewRawField { first { executable { execute { rows { __typename id label } } } } } } } }
I had to duplicate quite a bit of code from
\Drupal\viewsreference\Plugin\Field\FieldFormatter\ViewsReferenceFieldFormatter::viewElements()
.
I think it's worth considering outsouring the preparation / building of the view into maybe a trait.