magento2
magento2 copied to clipboard
magento/magento2#37803: Customer order filters graphql
Description (*)
Fixed Issue
- Fixes magento/magento2#37803
Manual testing scenarios (*)
1.Create a new Module CustomerOrder. 2.Create a schema.graphqls in Teeela/CustomerOrder/etc/ folder to extend the CustomerOrderFilterInput. Put following codes in this file:
input CustomerOrdersFilterInput @doc(description: "Identifies the filter to use for filtering orders.") { number: FilterStringTypeInput @doc(description: "Filters by order number.") created_at: FilterRangeTypeInput @doc(description: "Filters by created at.") status: FilterEqualTypeInput @doc(description: "Filters by status.") }
input FilterRangeTypeInput @doc(description: "Defines a filter that matches a range of values, such as prices or dates.") { from: String @doc(description: "The beginning of the range") to: String @doc(description: "The end of the range") }
input FilterEqualTypeInput @doc(description: "Defines a filter that matches the input exactly.") { in: [String] @doc(description: "An array of values to filter on") eq: String @doc(description: "A string to filter on") } 3.Use the following payload and {{your URL}}/graphql to query the customer token.
mutation { generateCustomerToken(email: "{{your email address}}", password: "{{your password}}") { token } } 4.Put above token in Postman Headers Authorization with Bearer {{your token}}. 5.Use following payload to query the above customer's sales orders.
query {
customer {
orders(filter: { created_at: { from: "2023-07-22" } status:{ in:["Processing"]} })
{
items {
number
created_at
}
}
}
Result:
orders from 2023-07-22 and status Processing
### 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)
- [ ] README.md files for modified modules are updated and included in the pull request if any [README.md predefined sections](https://github.com/magento/devdocs/wiki/Magento-module-README.md) require an update
- [ ] All automated tests passed successfully (all builds are green)
Hi @serbynskyi. Thank you for your contribution! Here are some useful tips on 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
:exclamation: 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:
-
Database Compare
-
Functional Tests CE
-
Functional Tests EE
-
Functional Tests B2B
-
Integration Tests
-
Magento Health Index
-
Sample Data Tests CE
-
Sample Data Tests EE
-
Sample Data Tests B2B
-
Static Tests
-
Unit Tests
-
WebAPI Tests
-
Semantic Version Checker
You can find more information about the builds here :information_source: Run only required test builds during development. Run all test builds before sending your pull request for review.
For more details, review the Code Contributions documentation. Join Magento Community Engineering Slack and ask your questions in #github channel.
@magento run all tests
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues.
@serbynskyi thank you for your Pull request. Can you also cover your changes with the web API function test?
Hey! take a look at this one: https://github.com/magento/magento2/pull/36949 @serbynskyi
@magento run all tests
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues.
@magento run WebAPI Tests, Static Tests, Integration Tests, Functional Tests EE, Functional Tests CE, Functional Tests B2B
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues.
@magento run Functional Tests CE
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues.
Working on web API test coverage.
@magento run Static Tests
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues.
@magento run WebAPI Tests
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues.
@magento run Static Tests
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues.
@magento run Static Tests, WebAPI Tests
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues.
@magento run all tests
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues.
@magento run WebAPI Tests
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues.
@magento run Functional Tests B2B, Functional Tests CE, Functional Tests EE, Integration Tests, WebAPI Tests
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues.
In discussion with Product Owner on this feature, till then moving it to On Hold.
@magento run all tests
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues.
@engcom-Hotel, the test coverage for customer order filter is present in Sales/CustomerOrders/CustomerOrdersTest.php Can you please have a look and do the needful. Moving it to Review.
Thank you!