I'm working my way through the MS Graph SDK documentation and building a list view in my app with a search query capability. I'm also implementing paging which isn't working correctly because the MS Graph is only returning the first two extensions from my collection (even without using query options for paging like 'top' & 'skipToken' included)
So two issues here to sort...
Firstly, when reviewing the MS Docs for List schemaExtensions they advise 'List schemaExtensions' method supports the OData Query Parameters to help customize the response.
The only filter two filters I can get to work is filtering by the owner, or filtering by the full Id string, examples shown below:
var schemaExtensions = await graphClient.SchemaExtensions
.Request()
.Filter("owner eq 'myAppIdString'")
.GetAsync();
OR - I can filter by the extension full name:
var schemaExtensions = await graphClient.SchemaExtensions
.Request()
.Filter("id eq 'ext7bxc3e0l_appRoleTemplate'")
.GetAsync();
I primarily want to filter using the 'endsWith' given no one is going to memorize the random prefix string that is automatically generated by Azure for the 'Id' when using the option for creating an extension that is not using a verified domain.
I've tried various different things for filtering by endsWith, but given MS don't provide any examples for filtering this way, other than using the Graph API directly then I don't have any examples to work with.
var schemaExtensions = await graphClient.SchemaExtensions
.Request()
.Filter("endsWith(id,'appRoleTemplate')") // Not working!
.GetAsync();
The second issue is the fact that filtering the extensions by owner will only return the first two extensions from my collection (I created 3qty in my testing)
If I remove the 'filter by owner' then I'm returned with a long list of results from other apps / developers. If I add some query options in the .request() for 'top' and 'skipToken' then paging through the results works correctly which is where I'm able to list/return the third extension I created.
var queryOptions = new List<QueryOption>
{
new QueryOption("$top", rowsPerPage.ToString()) // rows per page = 10
};
if (!string.IsNullOrEmpty(skipToken))
{
queryOptions.Add(new QueryOption("$skiptoken", skipToken));
}
var schemaExtensions = await graphClient.SchemaExtensions
.Request(queryOptions)
.Filter("owner eq 'myAppIdString'")
.GetAsync(); // example allows paging but only returns the first two of three extensions on the first run.
If I set the 'top' parameters to 1, i.e. return 1qty result at a time then this also works correctly when using paging and I'm able to page my way through to the third extension I created, but setting 'top' to 10 rows when filtering by owner will only ever return the first two extensions from my collection.
The fact that the SDK will only return the first two extensions from my own collection leads me to think there is a bug with the SDK. But not sure where the best place is to report this...
