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

Query.where() does not accept boolean as per latest types definitions #43

Closed
pveller opened this issue Jan 29, 2021 · 2 comments
Closed

Comments

@pveller
Copy link

pveller commented Jan 29, 2021

I have upgraded to 3.12.1 and the following Typescript code wouldn't compile:

stack.ContentType('my_content').Query().where('is_hidden', false),

This is due to this type definition:

where(key: string, value: (string | number)): Query;

The type definitions that I am looking at are:

// Type definitions for contentstack 3.12.0
// Project: https://www.contentstack.com/
// Definitions by: Contentstack <https://github.com/contentstack>

The implementation in SDK doesn't really care and will be fine with any:
https://github.com/contentstack/contentstack-javascript/blob/master/src/core/modules/query.js#L419

I have to do this to "trick" Typescript compiler to believe my code

declare module 'contentstack' {
  interface Query {
    where(key: string, value: string | number | boolean): Query;
  }
}
@uttamukkoji
Copy link
Contributor

Hi @pveller,
Thanks for raising the issue. We will add to support boolean.

uttamukkoji added a commit that referenced this issue Feb 19, 2021
#43 Typescript support to pass Boolean in where
@uttamukkoji
Copy link
Contributor

Hi @pveller ,

The type definition for the where function in Query is updated and will now allow to pass boolean.
We release the JS delivery SDK v3.12.2.

As the issue is resolved we are closing this issue. If you have any concern please feel free to reopen this issue or create issue.

Thanks

uttamukkoji added a commit that referenced this issue Oct 21, 2021
#43 Typescript support to pass Boolean in where
uttamukkoji added a commit that referenced this issue Oct 21, 2021
#43 Typescript support to pass Boolean in where
uttamukkoji added a commit that referenced this issue Oct 21, 2021
#43 Typescript support to pass Boolean in where
uttamukkoji added a commit that referenced this issue Dec 8, 2021
#43 Typescript support to pass Boolean in where
uttamukkoji added a commit that referenced this issue Mar 30, 2022
#43 Typescript support to pass Boolean in where
uttamukkoji added a commit that referenced this issue Mar 30, 2022
#43 Typescript support to pass Boolean in where
uttamukkoji added a commit that referenced this issue Mar 30, 2022
#43 Typescript support to pass Boolean in where
uttamukkoji added a commit that referenced this issue Mar 30, 2022
#43 Typescript support to pass Boolean in where
uttamukkoji added a commit that referenced this issue Mar 30, 2022
#43 Typescript support to pass Boolean in where
uttamukkoji added a commit that referenced this issue Mar 30, 2022
#43 Typescript support to pass Boolean in where
uttamukkoji added a commit that referenced this issue Mar 30, 2022
#43 Typescript support to pass Boolean in where
uttamukkoji added a commit that referenced this issue Mar 30, 2022
#43 Typescript support to pass Boolean in where
uttamukkoji added a commit that referenced this issue Mar 30, 2022
#43 Typescript support to pass Boolean in where
uttamukkoji added a commit that referenced this issue Mar 30, 2022
#43 Typescript support to pass Boolean in where
uttamukkoji added a commit that referenced this issue Mar 30, 2022
#43 Typescript support to pass Boolean in where
uttamukkoji added a commit that referenced this issue Mar 30, 2022
#43 Typescript support to pass Boolean in where
uttamukkoji added a commit that referenced this issue Mar 30, 2022
#43 Typescript support to pass Boolean in where
uttamukkoji added a commit that referenced this issue Mar 30, 2022
#43 Typescript support to pass Boolean in where
uttamukkoji added a commit that referenced this issue Mar 30, 2022
#43 Typescript support to pass Boolean in where
uttamukkoji added a commit that referenced this issue Mar 30, 2022
#43 Typescript support to pass Boolean in where
uttamukkoji added a commit that referenced this issue Mar 30, 2022
#43 Typescript support to pass Boolean in where
uttamukkoji added a commit that referenced this issue Mar 30, 2022
#43 Typescript support to pass Boolean in where
uttamukkoji added a commit that referenced this issue Mar 30, 2022
#43 Typescript support to pass Boolean in where
uttamukkoji added a commit that referenced this issue Mar 30, 2022
#43 Typescript support to pass Boolean in where
uttamukkoji added a commit that referenced this issue Mar 30, 2022
#43 Typescript support to pass Boolean in where
uttamukkoji added a commit that referenced this issue Mar 30, 2022
#43 Typescript support to pass Boolean in where
uttamukkoji added a commit that referenced this issue Mar 30, 2022
#43 Typescript support to pass Boolean in where
uttamukkoji added a commit that referenced this issue Mar 30, 2022
#43 Typescript support to pass Boolean in where
uttamukkoji added a commit that referenced this issue Mar 30, 2022
#43 Typescript support to pass Boolean in where
uttamukkoji added a commit that referenced this issue Mar 30, 2022
#43 Typescript support to pass Boolean in where
uttamukkoji added a commit that referenced this issue Mar 30, 2022
#43 Typescript support to pass Boolean in where
uttamukkoji added a commit that referenced this issue Mar 30, 2022
#43 Typescript support to pass Boolean in where
uttamukkoji added a commit that referenced this issue Mar 30, 2022
#43 Typescript support to pass Boolean in where
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

No branches or pull requests

2 participants