Skip to content

fix: pass dataType for orderBy entity queries#596

Open
baiirun wants to merge 3 commits intomainfrom
fix/orderby-pass-datatype
Open

fix: pass dataType for orderBy entity queries#596
baiirun wants to merge 3 commits intomainfrom
fix/orderby-pass-datatype

Conversation

@baiirun
Copy link
Contributor

@baiirun baiirun commented Feb 25, 2026

Summary

  • Pass dataType to entitiesOrderedByProperty for findManyPublic(..., { orderBy }) queries
  • Infer order-by data types from schema property metadata (string, number, boolean, date, point, schedule) and fail fast for unsupported fields
  • Add tests covering property-type to GraphQL dataType mapping used by ordered queries

Ordered entity queries started returning empty results on testnet because entitiesOrderedByProperty now requires a dataType argument. The SDK was forwarding propertyId and sortDirection but not dataType, so orderBy calls silently returned no rows.

This infers the GraphQL dataType from the schema property metadata, passes it with orderBy queries, and throws a clear error when an unsupported field is used for ordering. It also adds coverage for property-type to dataType mapping.
Keep passing inferred dataType when available, but allow orderBy queries to proceed without it so API-side fallback logic can resolve property types.
Make ordered queries include dataType only when it is resolvable, and avoid forcing a nullable dataType argument into every orderBy query. This keeps SDK behavior compatible with API fallback while preventing ambiguous null argument paths.

Also add request-level tests for findManyPublic orderBy payload wiring and move mapping checks into a focused orderBy test suite.
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.

1 participant