techniq/odata-query

TS error on $select when $orderBy added

romangobrey opened this issue · 1 comments

Hi,

What's wrong in this simple query?
buildQuery({ select: ['name1', 'name2'], top: 5, orderBy: 'createdon' });

For error see attached pic
Screenshot 2022-08-28 181701

Thank you!

I encountered the same issue, and it seems that it is related to Select type.

Currently, if we use only select we can pass whatever we want.

However, when we also use expand we cannot select other properties than those defined in expand. Here's reproduction.

example from screenshot

Screenshot 2023-03-08 at 16 44 59

I'm going to open a PR with a possible fix.