The Date/Time Picker field is added to the WPGraphQL Schema as field with the Type String
.
Date/Time Picker fields can be queried, and a String will be returned.
Here, we have a Date/Time Picker field named date_time_picker
on the Post Edit screen within the "ACF Docs" Field Group, and "20/03/2020 8:15 am" is the value.
This field can be queried in GraphQL like so:
{
post(id: "acf-example-test", idType: URI) {
acfDocs {
dateTimePicker
}
}
}
and the result of the query would be:
{
"data": {
"post": {
"acfDocs": {
"dateTimePicker": "20/03/2020 8:15 am"
}
}
}
}
- Previous Field: Date Picker
- Next Field: Email