-
Notifications
You must be signed in to change notification settings - Fork 123
Query taxonomy term inside ACF Repeater field #16
Comments
Thanks for reporting with such detail. I’ll look into this tomorrow and follow up. |
If this helps for more context, I moved the taxonomy out of the Repeater field, like to make it be just a standalone Taxonomy type field in ACF, and got the same results. After this last attempt that makes me think (in case this is a bug) that this is not related with having the Taxonomy type field nested inside a Repeater ACF field. It looks like Because for the record, querying this Taxonomy the regular way it does returns the terms values as expected. |
@elvismdev I'm looking into this now. |
Thanks @jasonbahl ! |
# Conflicts: # vendor/composer/autoload_static.php
@jasonbahl I have the same Issue with Taxomony-Fields inside a Flexible Content layout |
Okay so the problem I had with taxonomies was actually a different one. I didn't get all the pages with all the childPages and therefore the childPage with the taxonomy field wasn't available. |
I believe this issue comes from how WPGraphQL Core loaded terms in hierarchical taxonomies. For a while, WPGraphQL Core's loader would load only top level terms with parent=>0, and you had to explicitly ask for children. In the case of this ACF field, the underlying query ended up being something like: $query = new WP_Term_Query( [
'include' => [ 1, 2, 3 ]
'parent' => 0
] ); And let's say terms This query would return just term 1, because it's the only one with This was fixed in WPGraphQL core and from my testing this seems to be working in WPGraphQL for ACF now. CurrentCurrent behavior with:
I can set the value of a taxonomy field in a repeater with a top-level term and a grandchild term and get these terms in the response: Upcoming v0.6.0In the upcoming v0.6.0 release, the shape of the query changes a bit to respect the |
Hi,
I have an ACF Repeater field, with different types of fields inside of it. One of them is a WordPress Taxonomy, for which I cannot find how to return the values of the terms on it, it keeps returning just empty
[]
values.Here some screenshots to illustrate my ACF fields setup.
Here my query and the results from GraphQL, where it returns empty values for the taxonomy
Indicator
, despite that in my query I'm requesting their taxonomy ID and name.What I'm missing here?
The text was updated successfully, but these errors were encountered: