wp-graphql-acf
wp-graphql-acf copied to clipboard
ACF page link & Taxonomy link - cant access values chosen
It is listed as supported, but requires extra {} in the query, but the suggestion of graphiql is always "__typename" and won't suggest other fields. Perhaps I just need to know the underlying default values in the array.
{
events {
nodes {
title
content
attr { //ACF
eventLink
eventLinkLabel
internalEventLink { //<< THIS BAD BOY RIGHT HERE
__typename
}
datetime
endTime
audience
venueLocation
eventImage {
sourceUrl//<< OLD MATE HERE SUGGESTED ME A FEILD A-OK
}
bigOrSmall
}
}
}
}
Has there been any progress on this? Can’t see it in the projects as linked but having the same issue at the moment, trying to access a Page Link ACF field. As a workaround for the moment, I'm using inline fragments which allows me to get the fields I need:
heroButtonLink { // <-- Page Link ACF Field
... on Page {
uri
link
}
}
I'm also having this issue, but the inline fragments don't even work for me. I have a link between 2 custom post types, and although I can query both of them, the fragment to access the linked post doesn't work.
I've tried the post_object
field in ACF (returning both an object and an id), in the end I had to use the relationship
field
query MyQuery {
sentences(first: 2) {
nodes {
slug
testRelationObject {
posts {
... on Alignment {
id
}
}
}
}
}
alignments(first: 2) {
edges {
node {
id
}
}
}
}
This appears to have been fixed a while ago.
I'm able to create a field group with a "Page Link" field and query it as expected:
Attached is a JSON export of the Field Group I tested with (named "Delete Me" to make sure you remember to delete the test field group 😄)
acf-export-2023-07-11.json.zip
Tested on:
- WPGraphQL: v1.14.6
- WPGraphQL for ACF v0.6.1
Here's an example of querying the Page Link field type using the same exported field group with:
- WPGraphQL v1.14.6
- WPGraphQL for ACF v2.0.0-beta.3.1.0 (https://github.com/wp-graphql/wpgraphql-acf/releases)