Skip to content

Querying posts by custom field with WPGraphQL #621

Discussion options

You must be logged in to vote

Thanks for your question, Nazar.

Atlas Content Modeler does not support 'where' queries for field values via WPGraphQL by default.

If you need this feature now, you would have to write some custom PHP code following a guide like this one for ACF. The example adds support for the 'where' argument for a named ACF field that appears on the core Post type. It could be adapted for ACM's fields and custom post types.

Note that altering WPGraphQL or ACM behavior with custom code carries some risks (your code could break after updates to WPGraphQL or ACM), but here's a quick example if you want to explore it further:

  • You have a 'Rabbits' ACM model.
  • Rabbits has a text field called 'color'.
  • You wa…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by nickcernis
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants