1

I am using WP graphql to retrieve data from a wordpress site, plus this extension to show acf fields in the graphql schema.

I am querying pages (I did set up a seperate graphql connection called destinations but it is the same as the pages type for now). One each page there is a slider which is an acf relationship field that is a list of 'fragments' (a custom post type which has been registered with show_in_graphql set to true).

query MyQuery {
  destination(first: 200) {
    nodes {
      title
      fragmentSliderBlock {
        sliderItems {
          __typename
          ... on Fragment {
            id
            title
            date
          }
        }
      }
    }
  }
}

This is the current graphql output (I have edited to only show example 1 result):

{
  "data": {
    "destination": {
      "nodes": [
       
        {
          "title": "Example page",
          "fragmentSliderBlock": {
            "sliderItems": null
          }
        },
        
      ]
    }
  },
  "extensions": {
    "debug": [
      {
        "type": "DEBUG_LOGS_INACTIVE",
        "message": "GraphQL Debug logging is not active. To see debug logs, GRAPHQL_DEBUG must be enabled."
      }
    ]
  }
}

My problem is that the slider items always returns null. Other acf custom fields work fine, but the relationship field doesn't work. The pages do have items (fragments) selected, and the fields id, date, title on the fragment show up in the graphql explorer. Is there something else I need to do to make this work?

Thanks

OleG
  • 11
  • 1

0 Answers0