refine
refine copied to clipboard
fix(hasura): nested sorting abilities
Commit Message: Fix for issue #5348
##Commit Description:
This commit addresses issue #5348 by enhancing the sorting functionality in the GraphQL query generation. The modification includes the utilization of the reduceRight method to iterate over the fieldsArray in reverse order, constructing a nested structure for multi-sorting with nested fields.
Here's a breakdown of the changes:
- The
generateNestedSortingfunction now efficiently handles a single sorter, extracting both the field and order. - The field is split into an array of nested fields to support hierarchical sorting.
- Utilizing
reduceRight, the function iterates over the nested fields in reverse order, constructing the nested structure with the order as the leaf value.
The generateSorting function has been updated accordingly, mapping over the array of sorters and applying the enhanced generateNestedSorting function to each sorter. This modification ensures the generation of accurate GraphQL sort parameters for scenarios involving multi-sorting with nested fields.
IMPORTANT: Please ensure that any changes are discussed before proceeding. Failure to do so may result in the rejection of the pull request.
Details of Changes
This modification enhances the sorting mechanism in the GraphQL query generation to properly handle multi-sorting with nested fields. It addresses the specific requirements outlined in issue #5348.
Test Plan
Tests have been added/updated to verify the robustness of the code changes. The pull request is marked as a work in progress (WIP:) until thorough testing is completed.
Closing Issues
This pull request closes issue #5348.
Self Check before Merge
Please ensure the following tasks are completed before merging:
- [x] Corresponding issues are created/updated or not needed
- [x] Documentation is updated/provided or not needed
- [x] Examples are updated/provided or not needed
- [x] TypeScript definitions are updated/provided or not needed
- [ ] Tests are updated/provided or not needed
- [x] Changesets are provided or not needed
🦋 Changeset detected
Latest commit: b35abee90a1ed226381beb14b60d79c7e5b5ab55
The changes in this PR will be included in the next version bump.
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
Forgive if I made a mistake, I am a beginner in Open Source and am trying to improve myself. If there is anything to learn about or where I am making mistake, do let me know. I will try my best to improve myself.
Did the requested task, let me know if there's any change required or any mistake I am making.
@aliemir @BatuhanW Am I making any mistake here? If so, then can you guide me through my mistake and I will try not to repeat it again? I am new to writing test cases, that might be the mistake, I think. Sorry for it.
Deploy Preview for app-crm-minimal ready!
| Name | Link |
|---|---|
| Latest commit | be39f46dcec5f188dc8526bb31523cd115fe7085 |
| Latest deploy log | https://app.netlify.com/sites/app-crm-minimal/deploys/65aed49bf6edfc0008efe2d5 |
| Deploy Preview | https://deploy-preview-5508--app-crm-minimal.netlify.app |
| Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site configuration.
☁️ Nx Cloud Report
CI is running/has finished running commands for commit b35abee90a1ed226381beb14b60d79c7e5b5ab55. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.
📂 See all runs for this CI Pipeline Execution
✅ Successfully ran 1 target
Sent with 💌 from NxCloud.
@BatuhanW @omeraplak So sorry for disturbing you all with this small thing. I made the required change, I hope it helps.
Ok I will fix that issue 👍🏻
Hey @Conqxeror looking forward to your updates for the next March Release. 🙌🏼