WPGraphQL for Advanced Custom Fields
🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨
WPGraphQL for ACF has gone through a complete re-architecture and this repository will soon be archived.
We recommend you upgrade to the new WPGraphQL for ACF v2.0+ at your earliest convenience.
The new version contains breaking changes, so update with caution. Below are some resources to help:
🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨
NOTE: This release does not contain any functional changes and serves as a way to draw attention to the new version of WPGraphQL for ACF.
Full Changelog: https://github.com/wp-graphql/wp-graphql-acf/compare/v0.6.0...v0.6.1
Full Changelog: https://github.com/wp-graphql/wp-graphql-acf/compare/v0.5.3...v0.6.0
This release focuses primarily on Location Rules and how ACF Field Groups are mapped to the WPGraphQL Schema.
acf_get_term_post_id()
method. Thanks @sboerrigter!LOCATION, LOCATION, LOCATION!!!
This release primarily addresses issues related to Field Group location rules and adding field groups to the GraphQL Schema.
Prior to this release, ACF Field Groups were added to the GraphQL Schema strictly by analyzing the ACF Location Rules for the field group(s) and attempting to map the field group to the Schema.
Some rules are quite nuanced and hard to translate, and in some cases this meant that the Field Group would simply not show up in the Schema, or in other cases the field group wouldn't show exactly where you wanted.
This release brings a new way of mapping ACF Field Groups to the WPGraphQL Schema.
It still uses ACF Location Rules to try and "guess" where in the Schema the field group should show, but now it shows you where it will be and allows you to opt-out of the auto-mapping and set the GraphQL Types the field group should show on manually.
🎥 👉 This video walks through this new functionality: https://youtu.be/VvrZGrcwv0Y
📣 HUGE shout out to @drewbaker @rsm0128 and @funkhaus for putting a lot of time and energy into Location Rule revamp. Would not be where it is without your work!!! 🙌🏻
This adds support for ACF Fields to be shown with WPGraphQL Preview nodes. ACF revises meta, so when WPGraphQL returns a preview node, it uses the revised fields for ACF, where "normal" meta fields use the parent node's meta because "normal" meta is not revised.
Gutenberg (the new WordPress block editor) currently has a bug that's causing meta to not be revised after posts are published, so this feature (previewing ACF meta) only works when using the Classic editor