Show computed field in JSON:API output

Created on 12 April 2023, over 1 year ago
Updated 23 August 2023, about 1 year ago

I'm not seeing my computed field show up in JSON:API output with computed_field 4.x.

I was previously using computed_field 2.x and the field was appearing as expected in JSON:API output.

I updated to computed_field 4.x and created a plugin following the TestString.php example in test_computed_field_plugins very closely. (My computed field outputs a string as well.) I created the field via the "Add computed field" process in the UI and attached my plugin to it.

The computed field output shows up properly when the node is rendered in the site theme, but not when viewing the JSON:API output for the node. The field is not listed there at all.

I also tried modeling my plugin after the version of TestString.php that's in test_computed_field_output, (though I'm not sure I got the attach exactly right), but still nothing in JSON:API output.

Should the field just work? Is there something more I need to do to get it to show up?

Thanks in advance.

πŸ’¬ Support request
Status

Active

Version

4.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States jeffschuler Boulder, Colorado

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024