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

Upgrade GraphQL stack #1423

Merged
merged 7 commits into from
Dec 15, 2017
Merged

Upgrade GraphQL stack #1423

merged 7 commits into from
Dec 15, 2017

Conversation

salwator
Copy link
Contributor

@salwator salwator commented Dec 5, 2017

Closes #1330

This PR also changes the behavior of resolve_products resolver. This function used to return products belonging to the given category and its descendants. This PR changes it not to include products from the descendant categories. This is consistent with the behavior of category index view in the storefront.

Pull Request Checklist

  1. Privileged views and APIs are guarded by proper permission checks.
  2. All visible strings are translated with proper context.
  3. All data-formatting is locale-aware (dates, numbers, and so on).
  4. Database queries are optimized and the number of queries is constant.
  5. The changes are tested.
  6. The code is documented (docstrings, project documentation).
  7. Python code quality checks pass: pycodestyle, pydocstyle, pylint.
  8. JavaScript code quality checks pass: eslint.

@salwator salwator self-assigned this Dec 5, 2017
@codecov-io
Copy link

codecov-io commented Dec 6, 2017

Codecov Report

Merging #1423 into master will decrease coverage by <.01%.
The diff coverage is 94.11%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1423      +/-   ##
==========================================
- Coverage   82.44%   82.43%   -0.01%     
==========================================
  Files         131      131              
  Lines        5668     5665       -3     
  Branches      647      647              
==========================================
- Hits         4673     4670       -3     
  Misses        831      831              
  Partials      164      164
Impacted Files Coverage Δ
saleor/product/utils.py 85.44% <ø> (-0.21%) ⬇️
saleor/graphql/utils.py 54.54% <100%> (ø) ⬆️
saleor/graphql/api.py 81.92% <93.93%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 05e7f8b...0d8830b. Read the comment docs.

price_lte = args.get('price_lte')
price_gte = args.get('price_gte')
tree = self.get_descendants(include_self=True)
qs = qs.filter(categories__in=tree)
Copy link
Member

Choose a reason for hiding this comment

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

That distinct() was here to return proper results when there are multiple categories of the same name (this was added in PR #1331).

@maarcingebala maarcingebala merged commit 6f88660 into master Dec 15, 2017
@maarcingebala maarcingebala deleted the upgrade-graphql-stack branch December 15, 2017 16:22
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.

Upgrade GraphQL stack to version 2.x
3 participants