wp-graphql-acf
wp-graphql-acf copied to clipboard
Feature Request: Return Value as set in ACF - value, label, or both (Array)
Was recently getting an array from a radio field. GraphQL returned the values as expected. But ACF has a setting to Return Value with options Value, Label, or Both (Array). Having the ability to return the Label would have facilitated my data needs.
Screenshot for reference:
any news about that ? 👯
Small hack before the fix
add_filter('graphql_acf_field_value', function ($value, $field, $root, $id) {
if($field['key'] == 'MY_FIELD_KEY')
return $field['choices'][$value];
return $value;
}, 10, 4);
Any progress with that, please?
👋🏻 we're re-building WPGraphQL for ACF over here: https://github.com/wp-graphql/wpgraphql-acf
I've created a new issue in that repo to track this feature request. See: https://github.com/wp-graphql/wpgraphql-acf/issues/105
We'll be archiving this repo in the not-too-distant future, so I'm going to close this issue and we'll track this in the new repo.
Thanks!