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

Updating references to use Graph V1 and introducing BetaGraph extension #89

Merged
merged 3 commits into from
Apr 15, 2021

Conversation

shweaver-MSFT
Copy link
Member

Fixes #52

PR Type

What kind of change does this PR introduce?

  • Feature

What is the current behavior?

Currently, the Graph based projects use the Beta Graph SDK all the time. There is no V1 usage at the moment.

We need to use V1 for production/stability purposes, but sometimes we also need to make beta api calls (e.g. user photo). This is not possible currently.

What is the new behavior?

First off I've removed all references to the Beta Graph SDK, and added the v1 Microsoft.Graph nuget package instead.

I then organized the methods in the GraphExtensions to be split on the API type:

  • GraphExtensions.cs
  • GraphExtensions.People.cs
  • GraphExtensions.Users.cs

Lastly, I added a new extension method to the ProviderExtensions, IProvider.BetaGraph(). Calling BetaGraph will return a GraphServiceClient that is otherwise identical to the other, but with the base url updated to "https://graph.microsoft.com/beta". This allows the PersonView to make requests for photos that work, and without any Beta SDK references!

From PersonView.cs
await DecodeStreamAsync(await provider.BetaGraph().GetUserPhoto(UserId));

PR Checklist

Please check if your PR fulfills the following requirements:

  • Tested code with current supported SDKs
  • Sample in sample app has been added / updated (for bug fixes / features)
  • Tests for the changes have been added (for bug fixes / features) (if applicable)
  • Header has been added to all new source files (run build/UpdateHeaders.bat)
  • Contains NO breaking changes

Other information

@ghost
Copy link

ghost commented Apr 13, 2021

Thanks shweaver-MSFT for opening a Pull Request! The reviewers will test the PR and highlight if there is any merge conflict or changes required. If the PR is approved we will proceed to merge the pull request 🙌

@ghost ghost assigned azchohfi Apr 13, 2021
@shweaver-MSFT shweaver-MSFT merged commit 4e6ff94 into dev Apr 15, 2021
@shweaver-MSFT shweaver-MSFT deleted the shweaver/beta-fix branch April 15, 2021 18:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants