odata-query icon indicating copy to clipboard operation
odata-query copied to clipboard

TS error on $select when $orderBy added

Open romangobrey opened this issue 1 year ago • 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!

romangobrey avatar Aug 28 '22 15:08 romangobrey

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.

sitek94 avatar Mar 08 '23 15:03 sitek94