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 product fields in query Order > Lines > ProductVariant #378

Closed
jonyw4 opened this issue Jun 17, 2020 · 1 comment
Closed

Missing product fields in query Order > Lines > ProductVariant #378

jonyw4 opened this issue Jun 17, 2020 · 1 comment
Milestone

Comments

@jonyw4
Copy link
Contributor

jonyw4 commented Jun 17, 2020

Problem

Some crucial fields on Order.Lines.ProductVariant are missing, like slug and optionGroup.name and optionGroup.code. I use these fields to create a product link, so i think that fields are really important to user navigate in the storefront

Solutions

Add these fields in Order.Lines.ProductVariant or maybe create a Product field in this resolver to user choose witch fields they want to query.

@michaelbromley michaelbromley added this to the v1.0.0 milestone Jun 18, 2020
@michaelbromley
Copy link
Member

The simplest solution here is to define a ProductVariant.product field and an Option.group field respectively.

However, there is a danger involved here as we now have some new recursive types, e.g.

product {
  variants {
    product {
      variants {
        product {
          id
        }
      }
    }
  }
}

This creates a risk described in #381

The alternative of storing these values directly on the OrderLine entity removes that risk, but is inelegant as this is data that should be derived from live values, and is kinda the point of GraphQL in the first place.

I think the way forward is to solve 381 and then implement the fields & resolvers.

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

No branches or pull requests

2 participants