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

#254 - add back missing type declaration for options pages. #257

Merged

Conversation

jasonbahl
Copy link
Contributor

The underlying Options Page type declaration was removed in v0.5.0 release.

See: https://github.com/wp-graphql/wp-graphql-acf/pull/250/files?file-filters%5B%5D=.php&file-filters%5B%5D=.woff2&file-filters%5B%5D=.xml&file-filters%5B%5D=.yml&file-filters%5B%5D=dotfile#diff-a561f3a494f34edd4c3f2e83c25c8d4a9dc217eeeaed4385c735040450230ac0L1765

This PR adds it back and fixes null values being returned for option page values.

Steps to Reproduce

Adding the following Options Page:

	acf_add_options_page(array(
		'page_title' 	=> 'Theme General Settings',
		'menu_title'	=> 'Theme Settings',
		'menu_slug' 	=> 'theme-general-settings',
		'capability'	=> 'edit_posts',
		'redirect'		=> false,
		'show_in_graphql' => true,
		'graphql_field_name' => 'ThemeGeneralSettings',
	));

Then assigning an ACF Field Group to the Options Page:

Screen Shot 2021-04-28 at 10 26 47 AM

Then populating the settings field:

Screen Shot 2021-04-28 at 10 27 17 AM

Before

Querying the text field in the settings returns no value

Screen Shot 2021-04-28 at 10 25 49 AM

After

Querying the text field in the Settings returns the expected value

Screen Shot 2021-04-28 at 10 23 45 AM

Closes #254

@jasonbahl jasonbahl merged commit c854e17 into wp-graphql:develop Apr 28, 2021
This was referenced Apr 28, 2021
@marekbdzoch
Copy link

Its not working for me :/ @jasonbahl

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ACF Options fields null in Schema after latest update (v0.5.0)
2 participants