Skip to content

CartItem Product edge field "simpleAttributes" implemented and tested. #521

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

Merged

Conversation

kidunot89
Copy link
Collaborator

@kidunot89 kidunot89 commented Jul 5, 2021

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.

  • Make sure you are making a pull request against the develop branch (left side). Also you should start your branch off our develop.
  • Make sure you are requesting to pull request from a topic/feature/bugfix/devops branch (right side). Don't pull request from your master!
  • Have you ensured/updated that CLI tests to extend coverage to any new logic. Learn how to modify the tests here.

What does this implement/fix? Explain your changes.

Introduces 'simpleAttributes' edge field

mutation( $input: AddToCartInput! ) {
	addToCart(input: $input) {
		cartItem {
			product {
				simpleVariations {
					name
					value
				}
				node {
					databaseId
				}
			}
		}
	}
}

Does this close any currently open issues?

Resolves #517

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?

  • WooGraphQL Version: 0.10.0
  • WPGraphQL Version: 1.5.0
  • WordPress Version:
  • WooCommerce Version:

@kidunot89 kidunot89 self-assigned this Jul 5, 2021
@kidunot89 kidunot89 added this to the v0.10.1 milestone Jul 5, 2021
@kidunot89 kidunot89 force-pushed the feature/cart-item-one-to-one-edges branch from 7273f2e to bf863f9 Compare July 5, 2021 22:04
/**
* Class Attribute
*/
class Attribute {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Opening brace of a class must be on the line after the definition

*/
class Attribute {

/**
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spaces must be used to indent lines; tabs are not allowed

class Attribute {

/**
* Registers the "Product" interface.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spaces must be used to indent lines; tabs are not allowed


/**
* Registers the "Product" interface.
*
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spaces must be used to indent lines; tabs are not allowed

/**
* Registers the "Product" interface.
*
* @param \WPGraphQL\Registry\TypeRegistry $type_registry Instance of the WPGraphQL TypeRegistry.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spaces must be used to indent lines; tabs are not allowed

@codeclimate
Copy link

codeclimate bot commented Jul 5, 2021

Code Climate has analyzed commit bf863f9 and detected 119 issues on this pull request.

Here's the issue category breakdown:

Category Count
Complexity 1
Style 115
Clarity 3

The test coverage on the diff in this pull request is 90.9% (50% is the threshold).

This pull request will bring the total coverage in the repository to 77.2% (0.1% change).

View more on Code Climate.

@kidunot89 kidunot89 merged commit cb970f3 into wp-graphql:develop Jul 5, 2021
@kidunot89 kidunot89 deleted the feature/cart-item-one-to-one-edges branch July 5, 2021 22:18
@kidunot89 kidunot89 added enhancement New feature or request new fields Feature adds new fields to existing types labels Jul 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request new fields Feature adds new fields to existing types
Projects
None yet
Development

Successfully merging this pull request may close these issues.

How to retrieve a simple product attributes once added to cart ?
1 participant