Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing resolver for relationship between custom post type and Product gql #642

Closed
pairviewwebmaster opened this issue Jul 20, 2022 · 1 comment

Comments

@pairviewwebmaster
Copy link

I created a relationship using ACF between a custom post type (store) has a product. So the store has products. But keep getting this error when trying to query the related products under the Store.

Abstract type Store_StoreListing_RelateProduct must resolve to an Object type at runtime for field  Store_StoreListing.relateProduct with value \"instance of WPGraphQL\\Model\\Post\", received \"Product\". Either the  Store_StoreListing_RelateProduct type should provide a \"resolveType\" function or each possible type should provide an \"isTypeOf\" function.

Query is

 Store{
    nodes {
      StoreListing{
        fieldGroupName
        relateProduct {
          ... on Product {
            id
            name
          }
        }
      }
    }
  }

@kidunot89
Copy link
Member

@pairviewwebmaster This is a known issue, with a solution that has been in the works for a while 👉🏿 #565

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants