The relationship field in ACF establishes connections to other Post Types. Product is a Post Type, but WooGraphQL resolves Products differently than WPGraphQL resolves any other type of Post Type, so fields like this that expect a Post model to be returned don't get a Post model returned, but instead a Product.
To Reproduce
[
{
"key": "group_5e85643c0cc84",
"title": "Testing Product Relationship issue",
"fields": [
{
"key": "field_5e85644be0a13",
"label": "Post Products",
"name": "post_products",
"type": "relationship",
"instructions": "",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"show_in_graphql": 1,
"post_type": [
"product"
],
"taxonomy": "",
"filters": [
"search",
"post_type",
"taxonomy"
],
"elements": "",
"min": "",
"max": "",
"return_format": "object"
}
],
"location": [
[
{
"param": "post_type",
"operator": "==",
"value": "post"
}
]
],
"menu_order": 0,
"position": "normal",
"style": "default",
"label_placement": "top",
"instruction_placement": "label",
"hide_on_screen": "",
"active": true,
"description": "",
"show_in_graphql": 1,
"graphql_field_name": "TestingProductRelationshipIssue"
}
]query SampleQuery {
__typename
posts(first: 10) {
edges {
node {
title
TestingProductRelationshipIssue {
postProducts {
... on SimpleProduct {
id
name
sku
}
}
}
}
}
}
}Expected behavior
Should return results without errors
Screenshots
https://slack-files.com/T3PDM1KRC-F0118V1GM0D-eab1d0676d
Additional context
Slack message thread about the issue:
https://wp-graphql.slack.com/archives/CCYJRDN4A/p1585794638031200
@jholman101 I have located this issue, but it will take some changes in both WPGraphQL ACF and WooGraphQL for it to be resolved.
I've opened a PR in WPGraphQL ACF with the changes needed there.
If they get merged quickly, I'll include the WooGraphQL changes in Release v0.5.1
That is awesome news @kidunot89. Thank you so much for all you're doing with these plugins. It is truly appreciated.
Hey @kidunot89. Any update on this? Not sure if there's something I can do in the meantime that's filterable. Looks like @jasonbahl merged in some changes here: https://github.com/wp-graphql/wp-graphql/pull/1391
I do see that there's a closed PR that didn't get merged in the ACF plugin here: https://github.com/wp-graphql/wp-graphql-acf/pull/124
Thanks!
Here's my error message (flexible content field that references products)
{
"errors": [
{
"debugMessage": "Abstract type Page_Mediamodule_MediaModules_ProductModule_Products must resolve to an Object type at runtime for field Page_Mediamodule_MediaModules_ProductModule.products with value \"instance of WPGraphQL\\Model\\Post\", received \"Product\". Either the Page_Mediamodule_MediaModules_ProductModule_Products type should provide a \"resolveType\" function or each possible type should provide an \"isTypeOf\" function.",
"message": "Internal server error",
"extensions": {
"category": "internal"
},
"locations": [
{
"line": 7,
"column": 13
}
],
"path": [
"pages",
"nodes",
0,
"mediaModule",
"mediaModules",
6,
"products",
0
]
}
]
@jacobarriola Yea, but it's tied up in the v0.6.0 release right now. Try to get that out this week or beginning of next week.
All good, @kidunot89 馃憤馃徑
I appreciate all of the work.
Ping me if you need testers. I'm knee-deep in a WooGraphQL project atm, so there's lots of stuff for me to test.
I'm having this problem too, does any of those PR were merged?
The same problem. Is there a chance that it will be resolved?
I have also just come across this problem when using a Product Relation on this occasion the Taxonomy is accommodation-booking (https://woocommerce.com/products/woocommerce-accommodation-bookings/)
Note: I have also tried the relationship with a standard simple taxonomy and get the same result.


I followed the breadcrumb here https://github.com/wp-graphql/wp-graphql/issues/1388 | https://github.com/wp-graphql/wp-graphql/pull/1391 which looks to have been merge but doesn't seem to fix this bug.
Any ideas @jasonbahl @kidunot89
Thanks in advance.
Really sorry to bump this up so soon after posting and I also appreciate this is OS and that it is a: as and when/if warrants scenario with importance or detriment to the plugin.
I understand this would most likely need further investigation before being able to comment or fix but in the interim is there anything as a workaround that could perhaps band-aid this issue?
I have attempted to use the Example Filter Use: filter shown here (https://github.com/wp-graphql/wp-graphql/pull/1391) (also provided below) to intercept this model behaviour. On logging the filters args within side the if statement it never appears to be satisfied thus no logging.
add_filter( 'graphql_dataloader_pre_get_model', function( $model, $entry, $key, $this ) {
if ( $entry instanceof \WP_Post && 'product' === $entry->post_type ) {
return new \WPGraphQL\WooCommerce\Model\Product( $entry );
}
return $model;
}, 10, 4 );
Thanks in advance.
UPDATE
I have done some further debugging in to the WP-GraphQL plugin at the point this error is displayed.
wp-graphql/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php #1261 ensureValidRuntimeType()
When dumping out the get_class of the $runtimeType arg and Utils::printSafe($runtimeType) it returns a WPInterfaceType as opposed to WPObjectType which is the expected return.
string(42) "Page_Pagesections_Sections_PopularHolidays"
string(30) "WPGraphQL\Type\WPInterfaceType"
string(7) "Product"
Hello, is there an update on this issue? I have the same problem

Hi @RodrigoTomeES
Yes, there is an update on this issue here: https://github.com/wp-graphql/wp-graphql-woocommerce/issues/449#issuecomment-799894199
Hi @RodrigoTomeES
Yes, there is an update on this issue here: #449 (comment)
Hi, yes I saw it, but I have the latest version of the plugins but the errors persists