Wordpress Gatsby - How do i access ACF relationship content in graphql, or otherwise

admin

Administrator
Staff member
Using gatsby-source-wordpress I have a content type called 'student' which has a ACF relationship field that links to content type 'posts'. I want to show the related posts (title and other fields) on the student page.

On a student post i can get various fields of the related content, wordpress_id seems most useful (below is an example of the ACF relationship field on a 'student' set to show 'wordpress_id's:

Code:
{
   "node": {
      "acf": {
         "related_projects": [
            64,
            88,
            1
         ]
      }
   }
}

What i'd like to do is construct a graphQL query on the student page the selects all posts that match
Code:
enter code here
a set of wordpress_ids. I can see how to match a single id, but not multiple. Or can a single graphQL query be looped over on a page?