Adding an order filter to post relation custom field #3018
ptpittman
started this conversation in
Advanced Custom Fields
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm trying to figure out how to order the related posts from a field group, using 2.0.0. In this case specifically I have a custom Author post type ("post_author" is the registered post type), which then has a field group (registered graphql name is "postAuthorFields"), of which one of the fields is a group of related posts by that author.
What I want to be able to do in the simplified below query is add an "order by date DESC" sort of command on the posts connection. I know this isn't supported out of the box on the plugin and have read the many posts and reasonings on that, so I get it. The efficiency concerns in question are noted and understood, but not relevant to my use case. For all of my other opt-in custom orderings, I'm doing various register_graphql_field actions in my own plugin to add these orders, but on this one, I can't figure out on this one which connection I should register the extra arguments on (either as ...WhereArgs or even just as a boolean to sort at the main level of arguments, given there aren't other Where args present in this connection).
This is the sort of simplified action I'd imagine registering if it wasn't a where arg, but what field would I be registering it against in the above? I have a feeling it would be something along the lines of PostAuthorToAcfContentNodeConnection but it's not quite that...
Thanks for any nudges in the right direction! Even if just how to read the schema properly...
Beta Was this translation helpful? Give feedback.
All reactions