Please specify what version of the library you are using: [ 2.0.6 ]
Please specify what version(s) of SharePoint you are targeting: [ SPO ]
If you are not using the latest release, please update and see if the issue is resolved before submitting an issue.
Currently the PnP Graph client does not support sovereign cloud tenants. Many graph routes in GCC tenants will fail when ".us" is not used.
Graph client does not respect endpoint when given webpart context. It appears to always use ".com".
In GCC High tenant
const client = await this.context.msGraphClientFactory.getClient();
const res1 = await client.api('/me').get();
// Correctly uses endpoint "graph.microsoft.us"
graph.setup({
spfxContext: this.context
});
const res2 = await graph.me();
// Incorrectly uses endpoint "graph.microsoft.com"
// Notice the .us domain is NOT used.
This is a great issue, thanks for bringing it to our attention. We are going to aim on having this in the August release to give us time to test it out so we don't break existing deployments. Thanks again for reporting it!
Thank you! This will help us immensely.
This work is done and sitting in PR #1303 awaiting merging. Will be in 2.0.8 in August. You can see the updated docs articles there on how to handle it. Short answer:
baseUrl always takes precedence over any other url logic. Whatever you set there will be used for all requests.
Thank you so much!
Most helpful comment
Thank you so much!