wp-graphql-acf icon indicating copy to clipboard operation
wp-graphql-acf copied to clipboard

Regression on relationship fields since WPGraphQL 1.7.0

Open rodrigo-arias opened this issue 2 years ago • 13 comments

Since WPGraphQL 1.7.0 it is not possible to query relationship fields. I can't tell if it's a problem with the connectors or with the new version of GraphiQL

https://github.com/wp-graphql/wp-graphql/compare/v1.6.12...v1.7.0

Before

CleanShot 2022-04-11 at 19 38 48

After

CleanShot 2022-04-11 at 19 48 43

There is no difference between version 1.7.0 after npm i + npm build or version 1.8.0. Works fine until 1.6.12

ACF 5.9.5 WPGraphQL 1.7.0 - 1.8.0

rodrigo-arias avatar Apr 11 '22 22:04 rodrigo-arias

@jasonbahl , Please take a look

tsrCodes avatar Apr 15 '22 17:04 tsrCodes

@rodrigo-arias Found Any Solution Or Downgrade the version ??

tsrCodes avatar Apr 17 '22 16:04 tsrCodes

@tsrCodes I haven't dived into it, I just went back to 1.6.12 doesn't seem like a big deal for now, but potentially it will be if new versions of WPGraphQL introduce fixes or new features

rodrigo-arias avatar Apr 18 '22 14:04 rodrigo-arias

Agree with that , not a big problem @rodrigo-arias but Seems there's two major releases , after that

tsrCodes avatar Apr 18 '22 17:04 tsrCodes

I'm having the same issues, using Flexible Content with some relationship fields inside. Sometimes relationship fields will show up in the schema, but will always return null when queried for despite data being there. I tried downgrading to 1.6.12, but it completely broke the site (also using WP Gatsby, WPGraphQL for ACF, and WPGraphQL for Gravity Forms).

So far, Post Object is the only relationship field I've found that doesn't show up in the schema. Taxonomy and User fields in the relationship subset do show up in the schema, but always return null when queried for.

jordanlewis9 avatar May 17 '22 14:05 jordanlewis9

Problem with GraphiQL IDE https://github.com/wp-graphql/wp-graphql/issues/2370#issue-1229931135

tsrCodes avatar May 17 '22 15:05 tsrCodes

I want to come back to this to say that I've been able to get most relationship fields working. One thing I forgot to do inside of a custom post type declaration was to set Screen Shot 2022-05-25 at 9 48 42 AM This needs to be set in both the CPT, and any related taxonomies that may be related. I can now pull up relationship fields both in GraphiQL (running off of Gatsby) and on my headless site.

jordanlewis9 avatar May 25 '22 13:05 jordanlewis9

@jordanlewis9 Use CPT UI Plugin for New Post Types , they have support for WPGraphQL

tsrCodes avatar May 25 '22 15:05 tsrCodes

I double-checked just in case, but the relationships aren't working. The same happens with the latest current version of WPGraphQL 1.8.2

rodrigo-arias avatar May 25 '22 15:05 rodrigo-arias

Ah @rodrigo-arias , think problem with GraphiQL IDE itself means Query Composer doesn't help with quert field suggestions

Just Try like below

menus {
  ... on Post {
        title
    }
}

tsrCodes avatar May 25 '22 15:05 tsrCodes

@tsrCodes that's accurate, the connections are there, but Query Composer doesn't show them in the tree, nor does the autocomplete in the Query Editor.

rodrigo-arias avatar May 25 '22 20:05 rodrigo-arias

It would be nice to be able to resolve this to have access to this fix introduced in v1.7.0

rodrigo-arias avatar Jun 20 '22 23:06 rodrigo-arias

Described issue still present in WPGraphQL 1.10.0 and with latest update to WPGraphQL for Advanced Custom Fields 0.6.1

jensmercedesbenz avatar Sep 20 '22 19:09 jensmercedesbenz

This was fixed in release 1.12.0. Thank you so much @chrisherold!

rodrigo-arias avatar Oct 11 '22 18:10 rodrigo-arias