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

Commit

Permalink
Merge pull request #304 from seripap/develop
Browse files Browse the repository at this point in the history
Returning false for true_false values
  • Loading branch information
jasonbahl authored Sep 15, 2022
2 parents 4a02e09 + 4d054bd commit cb00ecd
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/class-config.php
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,18 @@ protected function register_graphql_field( string $type_name, string $field_name
$field_config['type'] = 'Float';
break;
case 'true_false':
$field_config['type'] = 'Boolean';
$field_config = [
'type' => 'Boolean',
'resolve' => function ($root, $args, $context, $info) use ($acf_field) {

$value = $this->get_acf_field_value($root, $acf_field, true);
if (empty($value)) {
$value = false;
}

return $value;
}
];
break;
case 'date_picker':
case 'time_picker':
Expand Down

0 comments on commit cb00ecd

Please sign in to comment.