wp-graphql-acf
wp-graphql-acf copied to clipboard
Relationship Field type throw error in graphql
Hi,
I'm getting error in graphql when field type is Relationship for Product type
.
I need to get relationship product data in graphql query, can You please assist how can I use this field type in graphql.
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
👋🏻 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. 🙏🏻