I create a new field in Custom Fields and give it a location, like this:
After that I activate the Show In GraphQL button and set acf name:
Now, I'm trying to make a query for acf globalOptions in wp-graphql and it gives me an error. Moreover, I can't find globalOptions either in suggestions or in the schema.
Docs:
How could I fix this problem?
Thanks in advance.
The problem was in a file functions.php
:
it was like:
acf_add_options_page(array(
'page_title' => __('Global Options'),
'menu_title' => __('Global Options'),
'autoload' => true,
));
But it should be like:
acf_add_options_page(array(
'page_title' => __('Global Options'),
'menu_title' => __('Global Options'),
'autoload' => true,
'show_in_graphql' => true
));
I was missing the 'show_in_graphql' => true
key:value pair.