Cache merging on ACF 1-to-1 relationships #3032
ptpittman
started this conversation in
Apollo GraphQL
Replies: 1 comment
-
Total guess, but does it go away if you rename the CPT/ACF group (or GraphQL name)? There's been several reports on Slack about WPGraphQL for ACF getting stumped when someone uses a reserved type (e.g. calling a Custom Taxonomy If not, I suggest you post in the #acf Slack channel or in the WPGraphQL for ACF repo for better visibility. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm using WPGraphQL with the latest ACF extension and Apollo GraphQL nextjs server side (app dir). All is working exceedingly well, but I'm getting one nagging error that I can't figure how best to shake. This doesn't have production impact particularly, it's just a warning, but I'd like to solve it as it shows up in every build.
Basically, there's a custom post type of "Author" that relates to a post as postAuthors, which has another field group inside of it of postAuthorFields.
so, in abstract simplified form,
Obviously, as with all other types, there's different shapes to the data I pull out of this in different parts of the site. But for some reason, this is the only model with which Apollo complains about not having a unique identifier in postAuthorFields with which to merge in its cache.
Its output, basically, is:
(Full link to actual message here)
It's possible I could write an elaborate custom merge specifically for this, but really it shouldn't be necessary - every postAuthorFields is 1-to-1 with a postAuthor, and that's its identifier (and there's no actual id for it selectable within the graph, nor should there really need to be). I'm curious if there's something about the ACF setup that might be triggering this only with these particular fields? Other 1-to-1s with field groups on other models, with similar variance in query shape, don't seem to trigger it.
Beta Was this translation helpful? Give feedback.
All reactions