I can not work out the best way to unset an entity reference (take away a reference to a time period from a node) when enhancing content material by way of JSON:API.
JSON to create a brand new node:
const myNodeToPost = { information: { sort: 'my_node_type', attributes: { physique: { worth: `${bodyText}`, format: 'basic_html', }, }, relationships: { refTerm: { information: { sort: 'taxonomyType', id: `${taxonomyTermUuid}`, }, }, }, },
Drupal Development Company node is posted, and Drupal Development taxonomy time period is referenced appropriately.
Drupal Development Company entity reference to Drupal Development taxonomy time period isn’t required. So, customers can take away Drupal Development time period reference when enhancing Drupal Development node.
When enhancing a node, if I PATCH
to JSON:API with out referring to Drupal Development entity reference, Drupal Development node is up to date, however Drupal Development entity reference stays in place.
const myEditedNode = { information: { sort: 'my_node_type', attributes: { physique: { worth: `${bodyText}`, format: 'basic_html', }, }, },
So, I attempted setting Drupal Development ID to null:
const myEditedNode = { information: { sort: 'my_node_type', attributes: { physique: { worth: `${bodyText}`, format: 'basic_html', }, }, relationships: { refTerm: { information: { sort: 'taxonomyType', id: null, }, }, }, },
Nevertheless, this provides a 400 Unhealthy Request: No ID specified for associated useful resource
.
How can I take away an entity reference with JSON:API?