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

Relationship Field type throw error in graphql

Open Ninenetics25 opened this issue 3 years ago • 1 comments

Hi, I'm getting error in graphql when field type is Relationship for Product type download.

I need to get relationship product data in graphql query, can You please assist how can I use this field type in graphql.

Ninenetics25 avatar Jun 24 '21 14:06 Ninenetics25

I got this issue when a post that is related was in draft mode. Perhaps that is the issue? You might want to check your relationship field for any that might be draft or any other mode but publish first.

I added a check for post status and have a PR in. https://github.com/wp-graphql/wp-graphql-acf/pull/285

or you can use my fork until the issue is resolved.

https://github.com/matt-antone/wp-graphql-acf

matt-antone avatar Aug 17 '21 16:08 matt-antone

👋🏻 We're re-building this plugin over here: https://github.com/wp-graphql/wpgraphql-acf

This issue has been resolved in the new plugin, as all relational fields now use Connections and the DataLoader under the hood, so even orphaned IDs will not cause errors.

I recommend making the switch to the new version of the plugin when you can (it is a major re-architecture with changes to the Schema, so it will require some refactoring to your projects, but I think you'll really find it a much better experience!)

Also, the new version will be the version released on WordPress.org in the not-too-distant future and this repo will be archived at that time.

I'm going to close this issue as it was resolved during the re-architecture. 🙏🏻

jasonbahl avatar Oct 31 '23 16:10 jasonbahl