Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing Nested taxonomy query support #25

Open
vinny17690 opened this issue Feb 10, 2021 · 0 comments
Open

Missing Nested taxonomy query support #25

vinny17690 opened this issue Feb 10, 2021 · 0 comments

Comments

@vinny17690
Copy link

Hi @jasonbahl,
Just wondering, does this plugin support nested tax queries (added example code below)? I have tried, but couldn't make it work. Looks like taxQuery is limited to only one relation field and one taxArray. Ideally, taxArray should accept the nested taxArray fields right?

Are there any plans to support it, i think it's very crucial to be able to narrow down results to exactly what we want instead of fetching all the data, and process on the frontend.

How do we write below query in WPGraphQL? Any help would be great. Thanks!

'tax_query' => array(
    'relation' => 'AND',
    array(
        'taxonomy' => 'post_tag',
        'terms' => array( 'gum', 'cereal', 'candy' ),
        'field' => 'slug',
        'operator' => 'IN',     
    )
    array(
        'relation' => 'OR',
        array(
            'taxonomy' => 'favorite_turtle',
            'terms' => array( 'Raphael' ),
            'field' => 'name',
            'operator' => 'NOT IN',
        ),
        array(
            'taxonomy' => 'favorite_soda',
            'terms' => array( 'RC' ),
            'field' => 'name',
        ),
    ),
),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant