-
-
Notifications
You must be signed in to change notification settings - Fork 141
feat: "product" and "variation" connections added to LineItem type #604
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
feat: "product" and "variation" connections added to LineItem type #604
Conversation
5ac35dd
to
0ec6943
Compare
$resolver = new PostObjectConnectionResolver( $source, $args, $context, $info, 'product_variation' ); | ||
|
||
if ( ! $id ) { | ||
return null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid too many return
statements within this method.
return null; | ||
} | ||
|
||
return $resolver |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid too many return
statements within this method.
'toType' => 'Product', | ||
'oneToOne' => true, | ||
'resolve' => function ( $source, array $args, AppContext $context, $info ) { | ||
$id = $source->productId; // @phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid variables with short names like $id. Configured minimum length is 3.
Code Climate has analyzed commit 008b9c9 and detected 4 issues on this pull request. Here's the issue category breakdown:
The test coverage on the diff in this pull request is 100.0% (50% is the threshold). This pull request will bring the total coverage in the repository to 75.0% (0.0% change). View more on Code Climate. |
Your checklist for this pull request
Thanks for sending a pull request! Please make sure you click the link above to view the contribution guidelines, then fill out the blanks below.
🚨Please review the guidelines for contributing to this repository.
What does this implement/fix? Explain your changes.
LineItem
fields'product
andvariation
changed to connections to be consist with theCartItem
type.Does this close any currently open issues?
Fixes #478
Any relevant logs, error output, GraphiQL screenshots, etc?
(If it’s long, please paste to https://ghostbin.com/ and insert the link here.)
Any other comments?
…
Where has this been tested?