Skip to content

Add option_type field within OptionValue type#184

Merged
kennyadsl merged 1 commit intomasterfrom
waiting-for-dev/add_option_type_to_option_values
Sep 14, 2021
Merged

Add option_type field within OptionValue type#184
kennyadsl merged 1 commit intomasterfrom
waiting-for-dev/add_option_type_to_option_values

Conversation

@waiting-for-dev
Copy link
Copy Markdown
Contributor

This allows to retrieve option value values along their option type
name, description, etc. E.g.:

query getProduct {
  productBySlug(slug: "solidus-t-shirt") {
    name
    description
    variants {
      nodes {
        id
        sku
        position
        prices {
          nodes {
            amount
            currency {
              htmlEntity
            }
          }
        }
        optionValues {
          nodes {
            id
            name
            presentation
            optionType {
              name
              position
              presentation
            }
          }
        }
      }
    }
  }
}

Fixes #171

@kennyadsl
Copy link
Copy Markdown
Member

@waiting-for-dev do you get why codeclimate is complaining?

This allows to retrieve option value values along their option type
name, description, etc. E.g.:

```graphql
query getProduct {
  productBySlug(slug: "solidus-t-shirt") {
    name
    description
    variants {
      nodes {
        id
        sku
        position
        prices {
          nodes {
            amount
            currency {
              htmlEntity
            }
          }
        }
        optionValues {
          nodes {
            id
            name
            presentation
            optionType {
              name
              position
              presentation
            }
          }
        }
      }
    }
  }
}
```

Fixes #171
@waiting-for-dev waiting-for-dev force-pushed the waiting-for-dev/add_option_type_to_option_values branch from 7d68a5a to 38df4ba Compare September 14, 2021 04:02
@waiting-for-dev
Copy link
Copy Markdown
Contributor Author

@waiting-for-dev do you get why codeclimate is complaining?

As part of the code to be pushed is auto-generated, it helped decrease the ratio of tested/non-tested code on my push. I added a test to be compliant. I don't think they're super-useful, but it's consistent with the approach taken in the extension, so it's fine by now.

@kennyadsl kennyadsl merged commit 87b2409 into master Sep 14, 2021
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

Successfully merging this pull request may close these issues.

Add option_type field to OptionValue type

2 participants