I’m developing a blog SPA with WordPress headless CMS and Next.js.
WPGraphQL: I want to get json using GraphQL for posts in order of popularity with GraphQL API for WordPress.
The official action hook below states that it won’t work without the meta key, but I actually tried it, but it returned null.
I made a plugin and described the action hook as it is.
https://www.wpgraphql.com/docs/build-your-first-wpgraphql-extension/
2
Answers
Mutation is complete. By writing in functions.php on WordPress
However, I wrote a filter with the code below, but it didn't work with WP_Query. What's wrong with the one-piece filter code?
The name of the filtered meta_key was incorrect.
No Good:
OK: