refine icon indicating copy to clipboard operation
refine copied to clipboard

fix(hasura): nested sorting abilities

Open Conqxeror opened this issue 1 year ago • 9 comments

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 generateNestedSorting function 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

Conqxeror avatar Jan 12 '24 13:01 Conqxeror

🦋 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

changeset-bot[bot] avatar Jan 12 '24 13:01 changeset-bot[bot]

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.

Conqxeror avatar Jan 12 '24 13:01 Conqxeror

Did the requested task, let me know if there's any change required or any mistake I am making.

Conqxeror avatar Jan 15 '24 10:01 Conqxeror

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

Conqxeror avatar Jan 18 '24 06:01 Conqxeror

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...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

netlify[bot] avatar Jan 22 '24 11:01 netlify[bot]

☁️ 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.

nx-cloud[bot] avatar Jan 22 '24 11:01 nx-cloud[bot]

@BatuhanW @omeraplak So sorry for disturbing you all with this small thing. I made the required change, I hope it helps.

Conqxeror avatar Jan 24 '24 07:01 Conqxeror

Ok I will fix that issue 👍🏻

Conqxeror avatar Jan 31 '24 08:01 Conqxeror

Hey @Conqxeror looking forward to your updates for the next March Release. 🙌🏼

BatuhanW avatar Feb 06 '24 12:02 BatuhanW