You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/spfx/web-parts/get-started/using-microsoft-graph-apis.md
+12-15Lines changed: 12 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
title: Building SharePoint Framework solutions, which use Microsoft Graph
3
3
description: Getting started tutorial on using Microsoft Graph with SharePoint Framework solutions
4
-
ms.date: 6/21/2022
4
+
ms.date: 8/24/2022
5
5
ms.localizationpriority: high
6
6
---
7
7
@@ -44,7 +44,8 @@ You can also follow these steps by watching this video on the Microsoft 365 Plat
44
44
45
45
- **Do you want to allow the tenant admin the choice of being able to deploy the solution to all sites immediately without running any feature deployment or adding apps in sites?**: Yes
46
46
- **Which type of client-side component to create?**: WebPart
47
-
- **Which framework would you like to use?**: No JavaScript framework
47
+
- **What is your Web part name?**: MyFirstGraphWebPart
48
+
- **Which framework would you like to use?**: No framework
48
49
49
50
At this point, Yeoman installs the required dependencies and scaffolds the solution files. Creation of the solution might take a few minutes. Yeoman scaffolds the project to include your **MyFirstGraphWebPart** web part as well.
50
51
@@ -104,13 +105,13 @@ In this case, we'll modify the code to use Microsoft Graph to get access on the
104
105
import * as MicrosoftGraph from '@microsoft/microsoft-graph-types';
105
106
```
106
107
107
-
1. Update the `render()` method as follows. Notice how we're using the `MSGraphClient` object for the Microsoft Graph calls. This object abstracts the access token handling, so that as a developer, you can concentrate on your business logic.
108
+
1. Update the `render()` method as follows. Notice how we're using the `MSGraphClientV3` object for the Microsoft Graph calls. This object abstracts the access token handling, so that as a developer, you can concentrate on your business logic.
108
109
109
110
```typescript
110
111
public render(): void {
111
112
this.context.msGraphClientFactory
112
113
.getClient('3')
113
-
.then((client: MSGraphClient): void => {
114
+
.then((client: MSGraphClientV3): void => {
114
115
// get information about the current user from the Microsoft Graph
115
116
client
116
117
.api('/me/messages')
@@ -119,21 +120,17 @@ In this case, we'll modify the code to use Microsoft Graph to get access on the
<span class="${ styles.title}">Welcome to SharePoint!</span>
127
-
<p class="${ styles.subTitle}">Use Microsoft Graph in SharePoint Framework.</p>
128
-
<div id="spListContainer" />
129
-
</div>
123
+
<div class="${styles.myFirstGraphWebPart}">
124
+
<div>
125
+
<h3>Welcome to SharePoint Framework!</h3>
126
+
<p>
127
+
The SharePoint Framework (SPFx) is a extensibility model for Microsoft Viva, Microsoft Teams and SharePoint. It's the easiest way to extend Microsoft 365 with automatic Single Sign On, automatic hosting and industry standard tooling.
128
+
</p>
130
129
</div>
131
-
</div>
132
130
</div>`;
133
131
134
132
// List the latest emails based on what we got from the Graph
135
133
this._renderEmailList(messages.value);
136
-
137
134
});
138
135
});
139
136
}
@@ -145,7 +142,7 @@ In this case, we'll modify the code to use Microsoft Graph to get access on the
0 commit comments