microsoftgraph / msgraph-sdk-javascript

Microsoft Graph client library for JavaScript
https://graph.microsoft.com
MIT License
754 stars 229 forks source link

Create a setter for baseUri #445

Closed nmetulev closed 1 year ago

nmetulev commented 3 years ago

Feature Request

Add the ability to set the baseUri of the graph client after the client has been initialized. This will make it easier to change the baseUri of the graph client in scenarios where the developer might not own the code that initializes the graph client (such as the Microsoft Graph Toolkit)

Describe the solution you'd like

const client = MicrosoftGraph.Client.init(...);

client.baseUri = 'https://graph.microsoft-ppe.com';

// or
client.setBaseUri('https://graph.microsoft-ppe.com');

Additional context

Request coming out of a request on the Microsoft Graph Toolkit to support additional baseUris:

https://github.com/microsoftgraph/microsoft-graph-toolkit/issues/1053 https://github.com/microsoftgraph/microsoft-graph-toolkit/issues/1030

AB#9222

nikithauc commented 3 years ago

@nmetulev Thank you for this feature request!

Adding to the description of this issue, we should discuss providing ways to modify the other client configs after the client is initialized.

nmetulev commented 3 years ago

Agree 💯

MIchaelMainer commented 3 years ago

My concerns:

jimmywim commented 3 years ago

Does anyone know if this issue is being picked up by MSFT or is it waiting to be fixed by the community?

nikithauc commented 3 years ago

@jimmywim This request will need some some more discussion with the Graph SDK team.

I would like to know what is your take on this issue?

jimmywim commented 3 years ago

@nikithauc No worries, would be good to know if this is on the timeline to be implemented or not.

Any solution that uses this SDK to communicate to MS Graph (for example Microsoft Graph Toolkit) is not currently portable to any National Cloud instances of Microsoft 365 (including GCC and Germany).

nikithauc commented 2 years ago

@jimmywim The Graph JS SDK works with the National Cloud instances, that is, "graph.microsoft.com", "graph.microsoft.us", "dod-graph.microsoft.us", "graph.microsoft.de", "microsoftgraph.chinacloudapi.cn", "canary.graph.microsoft.com"

Please let me know if the case is otherwise.

sebastienlevert commented 1 year ago

Was delivered as part of v3. Closing.