Closed gol4nsky closed 1 year ago
Not for option pages in specific (unless you edit the stub), but for all field groups you can do:
'fieldGroup' => ['show_in_graphql' => true],
inside of config/acf.php
Hi, thank you for answer, but it doesn't seems like it working, I can't see field group in graphql query
Are you using ACF 6.0+?
It looks like it should be 'show_in_rest' => 1
Yes, i'm using 6.1.3, after adding 'show_in_rest' => 1, still the same, not available in graphql query
Does it work if you add it to the field group directly in your options class?
Tried this myself. I'm not really sure the route/path the options page is supposed to have when registered with ACF? Is it even possible?
I'm using WPGraphQL for Advanced Custom Fields, https://github.com/wp-graphql/wp-graphql-acf#options-pages, but i guess i cant do it with acf composer so never mind, i'll do it with normal way, thank you
I see.
I could probably add something like a $settings
property to the Options class that merges with the options page registration so you could do something like public $settings = ['show_in_graphql' => true]
.
How does that sound?
I will be perfect :)
Try out composer require log1x/acf-composer:dev-master
Add:
/**
* The additional option page settings.
*
* @var array
*/
public $settings = ['show_in_graphql' => 1];
to your Options class. Let me know if it works.
It works prefect, thank you very much :)
It is possibile to enable by default "show_in_graphql" when new option page is creating ?