Skip to content

_save mutation does not add field values to created entity #14

Open
@Jehu

Description

@Jehu

What i am doing wrong here?
The nodes/entities are created but only with title. All other fields are always empty (shown as null ).
(Also: Required fields are not validated if empty)

Test No. 1 for custom entity "fhp_shop_fishing_license_sold" of bundle "fhp_shop"

mutation createOrderline($license: fhp_shop_fishing_license_sold_input_type) {
  fhp_shop_fishing_license_sold_save(entity: $license) {
    id
    title
    field_shop_description {
      value
      format
    }
    field_shop_firstname
    field_shop_lastname
    field_shop_mail
  }
}


{
  "license": {
    "title": "Some title",
    "field_shop_description": "<p>This is the body text.</p>",
    "field_shop_firstname": "Max",
    "field_shop_lastname": "Mustermann",
    "field_shop_street": "Some Street Name",
    "field_shop_housenumber": "123",
    "field_shop_zipcode": 12345,
    "field_shop_city": "MyCity",
    "field_shop_mail": "[email protected]",
    "field_shop_birthdate": 222048000,
    "field_shop_prize": 54,
    "field_shop_license_reference": 17
  }
}

------
Result:

{
  "data": {
    "fhp_shop_fishing_license_sold_save": {
      "id": "50",
      "title": "Some title",
      "field_shop_description": null,
      "field_shop_firstname": null,
      "field_shop_lastname": null,
      "field_shop_mail": null
    }
  }
}

Test No. 2 for node type "faq"

This node type has no default body-field, but a "field_body" which is configured as formatted multiline.

mutation createEntity($entity: node_faq_input_type) {
  node_faq_save(entity: $entity) {
    nid
    title
    field_body {
      value
      summary
      format
    }
  }
}


{
  "entity": {
    "title": "Test FAQ #1",
    "field_body": "<p>Works?</p>"    
  }
}

----------
Result:

{
  "data": {
    "node_faq_save": {
      "nid": "99718",
      "title": "Test FAQ #1",
      "field_body": null
    }
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions