-
-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
status: in progress 🚧Work on this has begunWork on this has beguntype: feature 🦋New feature or requestNew feature or request
Milestone
Description
What problem does this address?
Currently to use this plugin, you need to manually register_graphql_facet_type(), and then query the facet from RootQuery.
That's a lot of manual work for the user, as well as more verbose queries.
What is your proposed solution?
We should be able to use the existing FacetWP data to autoregister facets to the schema out of the box, ideally as an input on the connections's {Type}ConnectionWhereArgs.
Similarly, facet data can be added to the connection edge.
E.g.
query GetPosts($query: FacetQueryArgs, $after: String, $search: String, $orderBy: [PostObjectsConnectionOrderbyInput]) {
posts(first: 10, after: $after, where: {status: PUBLISH, search: $search, orderby: $orderBy, facetQuery: $query }) {
pageInfo {
hasNextPage
endCursor
}
selectedFacet {
name
label
choices {
value
label
count
}
}
nodes {
title
excerpt
}
}
}What alternatives have you considered?
No response
Additional Context
This would be a non-breaking enhancement
hsimah
Metadata
Metadata
Assignees
Labels
status: in progress 🚧Work on this has begunWork on this has beguntype: feature 🦋New feature or requestNew feature or request