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

[GraphQl][Wishlist] Implementing a new Query of getting customer wishlist #29148

Merged

Conversation

eduard13
Copy link
Contributor

@eduard13 eduard13 commented Jul 15, 2020

Description (*)

This PR is a follow up of the following discussion, that is supposed to introduce a new Query, that will return the customer wishlists.
For CE version, it will always return a single wishlist (as there is no possibility to create more wishlists), so probably it doesn't make sense to implement any kind of logic to limit it to just 1 result. What do you think?

Related Pull Requests

https://github.com/magento/partners-magento2-infrastructure/pull/26

Fixed Issues (if relevant)

N/A

Manual testing scenarios (*)

Get Customer's wishlist

query {
  customer {
    wishlists {
      items_count
      sharing_code
      items_v2 {
        id
      	quantity
      	description
      	added_at
      }
    }
  }
}

Get Customer's wishlist (wishlist_v2)

query {
  customer {
    wishlist_v2(id: 0) {
      items_count
      sharing_code
      updated_at
      items_v2 {
        id
        quantity
        description
        added_at
        ... on DownloadableWishlistItem {
            links_v2 {
                id
                title
                sample_url
            }
            samples {
                id
                title
                sample_url
            }
        }
        ... on ConfigurableWishlistItem {
            child_sku
            configurable_options {
                id
                option_label
                value_id
		value_label
            }
        }
        ... on BundleWishlistItem {
            bundle_options {
                id
                label
                type
		values {
                    id
                    label
                    quantity
                    price
                }
            }
        }
      }
    }
  }
}

Questions or comments

The new Query will also be working for Multiple Wishlists, that will return all the customer's wishlists. Additionally it supports pagination, that may be used in EE version.

cc. @nrkapoor, @DrewML, @prabhuram93

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds are green)

@m2-assistant
Copy link

m2-assistant bot commented Jul 15, 2020

Hi @eduard13. Thank you for your contribution
Here is some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento give me test instance - deploy test instance based on PR changes
  • @magento give me 2.4-develop instance - deploy vanilla Magento instance

❗ Automated tests can be triggered manually with an appropriate comment:

  • @magento run all tests - run or re-run all required tests against the PR changes
  • @magento run <test-build(s)> - run or re-run specific test build(s)
    For example: @magento run Unit Tests

<test-build(s)> is a comma-separated list of build names. Allowed build names are:

  1. Database Compare
  2. Functional Tests CE
  3. Functional Tests EE,
  4. Functional Tests B2B
  5. Integration Tests
  6. Magento Health Index
  7. Sample Data Tests CE
  8. Sample Data Tests EE
  9. Sample Data Tests B2B
  10. Static Tests
  11. Unit Tests
  12. WebAPI Tests

You can find more information about the builds here

ℹ️ Please run only needed test builds instead of all when developing. Please run all test builds before sending your PR for review.

For more details, please, review the Magento Contributor Guide documentation.

⚠️ According to the Magento Contribution requirements, all Pull Requests must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.

🕙 You can find the schedule on the Magento Community Calendar page.

📞 The triage of Pull Requests happens in the queue order. If you want to speed up the delivery of your contribution, please join the Community Contributions Triage session to discuss the appropriate ticket.

🎥 You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel

✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel

@ghost ghost added this to Pending Review in Pull Requests Dashboard Jul 15, 2020
@magento-engcom-team magento-engcom-team added Component: WishlistGraphQl Release Line: 2.4 Partner: Atwix Pull Request is created by partner Atwix partners-contribution Pull Request is created by Magento Partner labels Jul 15, 2020
@eduard13
Copy link
Contributor Author

@magento run all tests

@rogyar rogyar self-assigned this Jul 15, 2020
@nrkapoor nrkapoor added this to the 2.4.1 milestone Jul 15, 2020
@rogyar
Copy link
Contributor

rogyar commented Jul 16, 2020

The general idea looks good to me. But before jumping into details, I believe the schema/architecture should be approved by @paliarush.

Alex, could you share your thoughts, please, on this implementation?
Appreciate your time.

@nrkapoor
Copy link

The general idea looks good to me. But before jumping into details, I believe the schema/architecture should be approved by @paliarush.

Alex, could you share your thoughts, please, on this implementation?
Appreciate your time.

@rogyar I believe the changes were approved but we still need to merge the architecture PR. @DrewML @paliarush can you merge the PR?

@DrewML
Copy link

DrewML commented Jul 16, 2020

Apologies for the lag - architecture PR here magento/architecture#403

array $args = null
) {
if (!$this->wishlistConfig->isEnabled()) {
throw new GraphQlInputException(__('The wishlist is not currently available.'));
Copy link
Contributor

Choose a reason for hiding this comment

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

I would recommend some more meaningful explanation here. Otherwise, it might sound like EntityNotFound issue for some particular wishlist.

$collection->setPageSize($pageSize);
}

$result = [];
Copy link
Contributor

Choose a reason for hiding this comment

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

I would recommend using more specific names for variables

Suggested change
$result = [];
$wishlists = [];

@ghost ghost moved this from Pending Review to Changes Requested in Pull Requests Dashboard Jul 17, 2020
@rogyar rogyar added Auto-Tests: Covered All changes in Pull Request is covered by auto-tests Award: test coverage Award: category of expertise labels Jul 17, 2020
@rogyar
Copy link
Contributor

rogyar commented Jul 17, 2020

Hi @eduard13. Please, check my minor recommendations above. Thank you.

@eduard13
Copy link
Contributor Author

@magento run all tests

1 similar comment
@eduard13
Copy link
Contributor Author

@magento run all tests

@ghost ghost moved this from Ready for Testing to Review in Progress in Pull Requests Dashboard Aug 21, 2020
@prabhuram93 prabhuram93 moved this from Review in Progress to Testing in Progress in Pull Requests Dashboard Aug 21, 2020
@ghost ghost moved this from Testing in Progress to Review in Progress in Pull Requests Dashboard Aug 21, 2020
@ghost ghost moved this from Review in Progress to Ready for Testing in Pull Requests Dashboard Aug 21, 2020
@prabhuram93 prabhuram93 moved this from Ready for Testing to Testing in Progress in Pull Requests Dashboard Aug 21, 2020
@prabhuram93 prabhuram93 moved this from Testing in Progress to Merge in Progress in Pull Requests Dashboard Aug 21, 2020
@magento-engcom-team magento-engcom-team merged commit c23388d into magento:2.4-develop Aug 27, 2020
@m2-assistant
Copy link

m2-assistant bot commented Aug 27, 2020

Hi @eduard13, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

@ghost ghost moved this from Merge in Progress to Recently Merged in Pull Requests Dashboard Aug 27, 2020
@ghost ghost moved this from Recently Merged to Changes Requested in Pull Requests Dashboard Aug 31, 2020
@ghost ghost moved this from Changes Requested to Ready for Testing in Pull Requests Dashboard Sep 10, 2020
@dthampy dthampy moved this from Ready for Testing to Testing in Progress in Pull Requests Dashboard Sep 10, 2020
@dthampy dthampy moved this from Testing in Progress to Merge in Progress in Pull Requests Dashboard Sep 10, 2020
@dthampy dthampy moved this from Merge in Progress to Recently Merged in Pull Requests Dashboard Sep 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Pull Requests Dashboard
  
Recently Merged
Development

Successfully merging this pull request may close these issues.

None yet

9 participants