Closed intelligence closed 3 years ago
+1
try setting ['show_in_graphql' => true]
on your fields
Yup, that works, thanks @Log1x!
@Log1x Hi sorry to bother on an already closed "issue", how should be exactly added in my fields ['show_in_graphql' => true] ? Thanks in advance!
@yano1978 Add it to the group config
You can do it when creating the FieldsBuilder
$banner = new StoutLogic\AcfBuilder\FieldsBuilder('banner', [
'show_in_graphql' => true,
]);
or you can do it after
$banner = new StoutLogic\AcfBuilder\FieldsBuilder('banner');
...
$banner->setGroupConfig('show_in_graphql',true)
You can also set graphql_field_name
if needed
Hi @stevep and thanks for the quick reply and help. I have tried both options as you suggested but it doesn't seem to work?
Am I missing something? Thank you!
To confirm: you have the WPGraphQL for Advanced Custom Fields plugin installed?
Indeed these are plugins installed:
Hi @stevep again, just to let you know that, after some more diggings into wp_graphl documentation, I have finally found out how to add it here https://www.wpgraphql.com/docs/custom-post-types#filtering-an-existing-post-type Basically, for an already existing acf custom type, it's sufficient to add it with addfilter function into functions.php like in the example's link.
I hope it might help someone else 😉
Anyone managed to get acf-builder to play nice with WPGraphQL / WPGraphQL ACF? https://github.com/wp-graphql/wp-graphql-acf
Would be nice to be able to fields created with acf-builder to show up in the schema.