wp-graphql / wp-graphql-tax-query

Adds `tax_query` support to postObject connection queries using WP_Query
46 stars 16 forks source link

All taxonomy posts #14

Closed forepointmc closed 4 years ago

forepointmc commented 4 years ago

'terms' is a required field and doesn't accept wildcard, so how to get all of the posts under a taxonomy?

jasonbahl commented 4 years ago

@forepointmc how would you do this in WP_Query? If you can show an example I can help think of a way to do the same in WPGraphQL

forepointmc commented 4 years ago

Hi actually its taxonomy terms I'm trying to get. I can't find a way in wpgraphql to get the all the terms of a taxonomy like this function does:

$terms = get_terms( array( 'taxonomy' => 'post_tag', 'hide_empty' => false, ) );

forepointmc commented 4 years ago

I sorted it

query { yourtaxonomyname { edges { node { id name } } } }

done!