wp-graphql-woocommerce
wp-graphql-woocommerce copied to clipboard
(Query) Format currency in cart type
What does this implement/fix? Explain your changes.
Following the default behavior, I added the option to format currency in the cart fields. I had to change return type from null to 0 in some fields, just trying to follow the default behavior.
Does this close any currently open issues?
Not that I know
@kidunot89 the format
argument is optional. By default, the price is being returned already formatted as it was before.
So how do you advise me to add the RAW format in the first test? I haven't found a similar test of this argument to rely on.
@kidunot89 You can use aliases to use the same field twice in a query like this.
query {
cart {
subtotal
rawSubtotal: subtotal(format: RAW)
}
}
Code Climate has analyzed commit 4cd583d5 and detected 265 issues on this pull request.
Here's the issue category breakdown:
Category | Count |
---|---|
Complexity | 17 |
Duplication | 13 |
Style | 235 |
The test coverage on the diff in this pull request is 85.5% (50% is the threshold).
This pull request will bring the total coverage in the repository to 76.5% (0.0% change).
View more on Code Climate.