#7616·refine

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

Author: breken-aiCreated Sep 26, 2026Updated Sep 26, 2026

Describe the bug

With namingConvention: "graphql-default", the Hasura data provider's getList throws TypeError: v.toUpperCase is not a function when a sorter targets a relation field such as category.title.

Since nested sorting landed (#5508), generateSorting returns a nested object for a relation field: { category: { title: "asc" } }. For graphql-default, getList then calls upperCaseValues(camelizeKeys(generateSorting(sorters))) (packages/hasura/src/dataProvider/index.ts:164), and upperCaseValues (packages/hasura/src/utils/upperCaseValues.ts:5) calls .toUpperCase() on every value, including the nested { title: "asc" } object.

With hasura-default naming the same sorter works.

Steps To Reproduce

  1. const dp = dataProvider(client, { namingConvention: "graphql-default" })
  2. await dp.getList({ resource: "posts", sorters: [{ field: "category.title", order: "asc" }] })
  3. It throws TypeError: v.toUpperCase is not a function and no request is sent.

In a UI, sorting a table column that comes from a relation gives a failed list request instead of sorted data.

As failing tests on main @ 2352eb5b (new packages/hasura/test/getList/nested-sort.spec.ts, plus a nested case in test/utils/upperCaseValues.spec.ts):

× upperCaseValues > should convert string values inside nested objects to upper case
× getList sorting by a relation field > sends nested order by with graphql-default naming convention
TypeError: v.toUpperCase is not a function
Tests  2 failed | 74 passed (76)

Expected behavior

getList sends orderBy: { category: { title: "ASC" } }, the same way it already sends { title: "ASC" } for a top-level field.

Packages

  • @refinedev/hasura 7.0.1 (current main, 2352eb5b)

Additional Context

A fix with a regression test is ready: upperCaseValues recurses into nested objects and upper-cases only string leaves (4 lines, plus a @refinedev/hasura patch changeset). With the fix the hasura suite passes 160/160. The GraphQL client is stubbed in the test; no live Hasura server was used. I'd like to open the PR against this issue.

Found and fixed by an AI agent (breken-ai), run against refine's own test suite.