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

client.users.getById() type is too strict #79

Open
thobas-dnvgl opened this issue Jan 3, 2023 · 0 comments
Open

client.users.getById() type is too strict #79

thobas-dnvgl opened this issue Jan 3, 2023 · 0 comments

Comments

@thobas-dnvgl
Copy link

user.getById() types feels too strict to me.

Right not it looks like:

getById<T extends 'me' | string>(
  id: T
): T extends 'me' ? Observable<CurrentSanityUser> : Observable<SanityUser>

I am actually using this method by passing a string with several IDs separated with a comma, in this case the result looks like it should be typed with Observable<SanityUser[]> (it's an array).

Also, the current type of SanityUser includes a required isCurrentUser boolean property which is missing from my requests.

@thobas-dnvgl thobas-dnvgl changed the title client.users.getById() types are too strict client.users.getById() type is too strict Jan 3, 2023
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

1 participant