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

Latest commit

 

History

History
40 lines (30 loc) · 822 Bytes

color-picker.md

File metadata and controls

40 lines (30 loc) · 822 Bytes

Color Picker Field

The Color Picker field is added to the WPGraphQL Schema as field with the Type String.

Color Picker fields can be queried and a String will be returned.

Here, we have a Color Picker field named color_picker on the Post Edit screen within the "ACF Docs" Field Group, and "#dd3333" is the value.

Color Picker field in the Edit Post screen

This field can be queried in GraphQL like so:

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

and the result of the query would be:

{
  "data": {
    "post": {
      "acfDocs": {
        "colorPicker": "12:30 am"
      }
    }
  }
}