Skip to content

28584 fixed issue category query does not handle fragments #28710

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
merged 6 commits into from
Jun 27, 2020

Conversation

munkhulzii
Copy link

Fixed issue #28584

fixed category query with inline fragments
fixed total_count of products in category

@m2-assistant
Copy link

m2-assistant bot commented Jun 12, 2020

Hi @munkhulzii. 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.

Copy link
Contributor

@danielrenaud danielrenaud left a comment

Choose a reason for hiding this comment

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

This looks good, and is working as expected for inline fragments.
However, it does not work for named fragements
e.g.

{
  categoryList(filters: {ids: {in: ["11"]}}) {
    ...Cat
  }
}

fragment Cat on CategoryTree {
  name
  position
  url_key
}

throws error:

Argument 2 passed to Magento\\CatalogGraphQl\\Model\\Resolver\\Products\\DataProvider\\CategoryTree::joinAttributesRecursively() must be an instance of GraphQL\\Language\\AST\\FieldNode, instance of GraphQL\\Language\\AST\\FragmentSpreadNode given, called in /Users/drenaud/valet-magento/partners/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/CategoryTree.php on line 144

28584 fix typo

28584 fix typo

28584 implement fragment spread for category
@munkhulzii munkhulzii force-pushed the 28584_graphql_fragment_categorylist branch from 9c3c349 to 4511c46 Compare June 15, 2020 15:06
Copy link
Contributor

@danielrenaud danielrenaud left a comment

Choose a reason for hiding this comment

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

I think it would be preferable to pass resolveInfo down via methods arguments rather than setting it as a class member

Copy link
Contributor

@danielrenaud danielrenaud left a comment

Choose a reason for hiding this comment

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

Generally looks good, just a few minor comments. Please rerun builds, I think there will be some static failures to address.

@danielrenaud danielrenaud added this to the 2.4.1 milestone Jun 18, 2020
@danielrenaud danielrenaud linked an issue Jun 18, 2020 that may be closed by this pull request
@danielrenaud
Copy link
Contributor

@magento run all tests

Copy link
Contributor

@danielrenaud danielrenaud left a comment

Choose a reason for hiding this comment

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

check failing static tests.
unit tests are failing for some other reason, I wouldn't worry about them at this point

@munkhulzii
Copy link
Author

@magento run all tests

@munkhulzii
Copy link
Author

@magento run all tests

Copy link
Contributor

@danielrenaud danielrenaud left a comment

Choose a reason for hiding this comment

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

Check web api functional tests

@munkhulzii
Copy link
Author

@magento run all tests

@m2-assistant
Copy link

m2-assistant bot commented Jun 27, 2020

Hi @munkhulzii, 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.

@okorshenko okorshenko deleted the 28584_graphql_fragment_categorylist branch August 25, 2020 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Category query does not handle fragments
4 participants