wp-graphql / wpgraphql-acf

Re-architecture of WPGraphQL for ACF
GNU General Public License v3.0
91 stars 12 forks source link

Add Connection Type to taxonomy field #219

Open traed opened 5 months ago

traed commented 5 months ago

What problem does this address?

When using a post object field we can select the GQL connection type (one-to-one or on-to-many) but this is not available when using the taxonomy field. If we want to have a field that represents a single taxonomy term (for example a "primary category") the GQL query will return an array of nodes regardless.

What is your proposed solution?

Add the same connection type setting as the post type field has or infer it from the taxonomy field's appearance field.

What alternatives have you considered?

No response

Additional Context

No response

jasonbahl commented 4 months ago

@traed thanks for opening this issue! I think this makes sense as an option on the Taxonomy field.

Let me know if you're interested in opening a PR! 🙏🏻