Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aggregation type parameters should have defaults #10101

Closed
tajakobsen opened this issue Mar 23, 2023 · 0 comments
Closed

Aggregation type parameters should have defaults #10101

tajakobsen opened this issue Mar 23, 2023 · 0 comments
Assignees
Labels
Milestone

Comments

@tajakobsen
Copy link
Collaborator

The recent changes in contentLib and nodeLib forces a developer to specify Aggregation type parameters when using the parameter and result interfaces for query() et al.

By adding some default type parameters the developers would not need to deal with missing Aggregation type parameters if they are not needed anyway.

-function getById(id: string): ContentsResult<ContentArticle, never> { ... }
+function getById(id: string): ContentsResult<ContentArticle> { ... }
tajakobsen added a commit to tajakobsen/xp that referenced this issue Mar 23, 2023
`never` is used as the default type parameter for the `aggregation`
properties in the different QueryParams.

`undefined` is used as the default type parameter for `aggregations`
in different query results. The reason `never` is not used is that
since the property is not optional, we are not able to construct this
object independently of the library functions.
@rymsha rymsha added the Bug label Mar 23, 2023
@rymsha rymsha added this to the 7.12.2 milestone Mar 23, 2023
alansemenov pushed a commit that referenced this issue Mar 28, 2023
`never` is used as the default type parameter for the `aggregation`
properties in the different QueryParams.

`undefined` is used as the default type parameter for `aggregations`
in different query results. The reason `never` is not used is that
since the property is not optional, we are not able to construct this
object independently of the library functions.
rymsha pushed a commit that referenced this issue Apr 5, 2023
`never` is used as the default type parameter for the `aggregation`
properties in the different QueryParams.

`undefined` is used as the default type parameter for `aggregations`
in different query results. The reason `never` is not used is that
since the property is not optional, we are not able to construct this
object independently of the library functions.

(cherry picked from commit 8d1c425)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants