Skip to content

fix(hasura): upper-case nested sort orders for graphql-default naming - #7619

Open
breken-ai wants to merge 1 commit into
refinedev:mainfrom
breken-ai:fix/hasura-graphql-default-nested-sort
Open

breken-ai wants to merge 1 commit into
refinedev:mainfrom
breken-ai:fix/hasura-graphql-default-nested-sort

Conversation

@breken-ai

Copy link
Copy Markdown

PR Checklist

Please check if your PR fulfills the following requirements:

Bugs / Features

What is the current behavior?

With namingConvention: "graphql-default", getList upper-cases sort orders with upperCaseValues(camelizeKeys(generateSorting(sorters))) (packages/hasura/src/dataProvider/index.ts:164). Since nested sorting (#5508), a relation sorter like category.title produces { category: { title: "asc" } }, and upperCaseValues (packages/hasura/src/utils/upperCaseValues.ts:5) calls toUpperCase on that nested object: TypeError: v.toUpperCase is not a function.

What is the new behavior?

upperCaseValues recurses into nested objects and upper-cases only string leaves, so getList sends orderBy: { category: { title: "ASC" } }. hasura-default is unchanged.

fixes #7616

Tests: new packages/hasura/test/getList/nested-sort.spec.ts (hasura-default and graphql-default), plus a nested case in test/utils/upperCaseValues.spec.ts.

  • on main @ 2352eb5b: 2 failed with TypeError: v.toUpperCase is not a function
  • with this PR: hasura 160/160 passed (19 files)

Notes for reviewers

4-line change plus a @refinedev/hasura patch changeset. The GraphQL client is stubbed in the test; no live Hasura server was used. This PR was prepared by an AI agent (breken-ai) and verified with the red/green test above.

@changeset-bot

changeset-bot Bot commented Sep 26, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: d522dbe

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@refinedev/hasura Patch

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

This branch has not been deployed

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

[BUG] hasura getList throws "v.toUpperCase is not a function" when sorting by a relation field with graphql-default

1 participant