- 🇵🇱Poland dmitry.korhov Poland, Warsaw
Hello @bbrala,
Do you have any ETAs for this?
Thanks
Using entity_reference_revisions
fields w/ JSON:API in write-mode is quite hard because you have to know the (numerical) revision identifier to pass in "meta" : { "target_revision_id": ... }
.
This is (more and more) a widespread issue because entity_reference_revisions
field type is the underlying field type for referencing paragraphs, which is, in turn, heavily used in complex content models.
But most of the time, you just want to reference "the latest revision".
So let's implement a Field Enhancer in JSON:API Extras to allow consumers to pass a special token instead of the numerical id and swap that on the fly.
I propose : @<entity_type>:latest
The reason we need to require the consumer to provide the target entity type is because currently we have no means of getting this info from field info in the enhancer implementation.
The body of a JSON:API request data would look like the following example :
{
"data": {
"id": "2f791080-aa7e-46b9-86bc-cd5a494413c6",
"type": "node--article",
"relationships": {
"field_associated_content": {
"data": {
"type": "node--page",
"id": "31ed9d00-9a62-428c-8800-38880d93f982",
"meta": {
"target_revision_id": "@node:latest"
}
}
}
}
}
}
Needs review
3.0
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
Hello @bbrala,
Do you have any ETAs for this?
Thanks