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

UsedRangeRequestBuilder.GetAsync uses DefaultQueryParameters #2696

Open
kevinib opened this issue Oct 3, 2024 · 1 comment
Open

UsedRangeRequestBuilder.GetAsync uses DefaultQueryParameters #2696

kevinib opened this issue Oct 3, 2024 · 1 comment
Labels
dependency:metadata Awaiting fix from core dependency project module type:bug A broken experience

Comments

@kevinib
Copy link

kevinib commented Oct 3, 2024

I'm trying to specify the "Select" QueryParameters in the GetAsync, but since it is using the DefaultQueryParamters, I can not use it.

In the Graph Explorer, I used the following query:
https://graph.microsoft.com/v1.0/me/drive/items/{drive-item-id}/workbook/worksheets('Sheet1')/usedrange?$select=address

In the Code snippets, it generates the following code:

var result = await graphClient.Drives["{drive-id}"].Items["{driveItem-id}"].Workbook.Worksheets["{workbookWorksheet-id}"].UsedRange.GetAsync((requestConfiguration) =>
{
	requestConfiguration.QueryParameters.Select = new string []{ "address" };
});

But this is not available in the SDK.

@kevinib kevinib added the status:waiting-for-triage An issue that is yet to be reviewed or assigned label Oct 3, 2024
@andrueastman andrueastman added type:bug A broken experience dependency:metadata Awaiting fix from core dependency project module and removed status:waiting-for-triage An issue that is yet to be reviewed or assigned labels Oct 8, 2024
@andrueastman
Copy link
Member

Thanks for raising this @kevinib

This looks to be an issue with the API metadata used to generate the SDK that lacks the information to generate the $select parameter.

You can however work around this using the WithUrl as below.

            var result = await graphClient.Drives["{drive-id}"].Items["{driveItem-id}"].Workbook.Worksheets["{workbookWorksheet-id}"].UsedRange
                                .WithUrl("https://graph.microsoft.com/v1.0/me/drive/items/{drive-item-id}/workbook/worksheets('Sheet1')/usedrange?$select=address")
                                .GetAsync();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependency:metadata Awaiting fix from core dependency project module type:bug A broken experience
Projects
None yet
Development

No branches or pull requests

2 participants