Skip to content

Disallow arrays in orderBy of SomeQuery#68

Closed
SH-Exact wants to merge 2 commits into
masterfrom
orderBy_type_safety_in_SomeQuery
Closed

Disallow arrays in orderBy of SomeQuery#68
SH-Exact wants to merge 2 commits into
masterfrom
orderBy_type_safety_in_SomeQuery

Conversation

@SH-Exact

Copy link
Copy Markdown
Contributor

This PR introduces a NonArrayProps type which strips away array properties of a type to be able to use orderBy in a SomeQuery with proper types. The types which can be used for orderBy in a SomeQuery are basically the *_Filter_Props types without arrays.

@SH-Exact SH-Exact self-assigned this Jun 11, 2026
Comment thread src/generator/01-base/static/queriesWithQueryLanguage.ts.txt

export type SomeQuery<E, F, I, P> = SomeQueryBase<E, F, I, P> &
({ sort?: Sort<E>[]; orderBy?: never } | { sort?: never; orderBy?: OrderBy<F>[] });
({ sort?: Sort<E>[]; orderBy?: never } | { sort?: never; orderBy?: OrderBy<NonArrayProps<F>>[] });

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is still possible to use array properties in the orderBy query. In the following example the topics prop of opportunity entity is available.

Image

@SH-Exact SH-Exact closed this Jun 18, 2026
@SH-Exact

Copy link
Copy Markdown
Contributor Author

Won't be done for now.

@SH-Exact SH-Exact deleted the orderBy_type_safety_in_SomeQuery branch June 18, 2026 09:52
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.

2 participants