Skip to content
This repository has been archived by the owner on Jul 23, 2024. It is now read-only.

Latest commit

 

History

History
44 lines (35 loc) · 1012 Bytes

group.md

File metadata and controls

44 lines (35 loc) · 1012 Bytes

Group Field

Group Fields are added to the WPGraphQL Schema as fields resolving to an Object Type named after the Group.

Here, we have a Group field named group on the Post Edit screen within the "ACF Docs" Field Group. Within the "group" field, we have a Text Field named text_field_in_group and a Text Area field named text_area_field_in_group

Group field in the Edit Post screen

We can query the fields within the group like so:

{
  post(id: "acf-example-test", idType: URI) {
    acfDocs {
      group {
        textFieldInGroup
        textAreaFieldInGroup
      }
    }
  }
}

And the results of the query would be:

{
  "data": {
    "post": {
      "acfDocs": {
        "group": {
          "textFieldInGroup": "Text value, in group",
          "textAreaFieldInGroup": "Text are value, in group"
        }
      }
    }
  }
}