Skip to content

Commit ba1cbd7

Browse files
updated the reference for MSGraphClient to MSGraphClientV3
1 parent 9dc7315 commit ba1cbd7

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

docs/spfx/use-aad-tutorial.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ Now you can update the **GraphConsumer** React component under the **./src/webpa
252252
} from "office-ui-fabric-react";
253253
import * as React from "react";
254254
255-
import { AadHttpClient, MSGraphClient } from "@microsoft/sp-http";
255+
import { AadHttpClient, MSGraphClientV3 } from "@microsoft/sp-http";
256256
import { escape } from "@microsoft/sp-lodash-subset";
257257
258258
import { ClientMode } from "./ClientMode";
@@ -453,11 +453,11 @@ When you package and deploy your solution, you (or an admin) will have to grant
453453
You can now implement the methods to consume the Microsoft Graph. You have two options:
454454

455455
- Use the **AadHttpClient** client object
456-
- Use the **MSGraphClient** client object
456+
- Use the **MSGraphClientV3** client object
457457

458458
The **AadHttpClient** client object is useful for consuming any REST API. You can use it to consume Microsoft Graph or any other third-party (or first-party) REST API.
459459

460-
The **MSGraphClient** client object can consume the Microsoft Graph only. Internally it uses the **AadHttpClient** client object and supports the fluent syntax of the Microsoft Graph SDK.
460+
The **MSGraphClientV3** client object can consume the Microsoft Graph only. Internally it uses the **AadHttpClient** client object and supports the fluent syntax of the Microsoft Graph SDK.
461461

462462
### Using AadHttpClient
463463

@@ -524,9 +524,9 @@ private _searchWithAad = (): void => {
524524

525525
The `get()` method gets the URL of the OData request as the input argument. A successful request returns a JSON object with the response.
526526

527-
### Using MSGraphClient
527+
### Using MSGraphClientV3
528528

529-
If you're targeting Microsoft Graph, you can use the **MSGraphClient** client object, which provides a more fluent syntax.
529+
If you're targeting Microsoft Graph, you can use the **MSGraphClientV3** client object, which provides a more fluent syntax.
530530

531531
The following example shows the implementation of the `_searchWithGraph()` method of the sample solution.
532532

@@ -537,8 +537,8 @@ private _searchWithGraph = () : void => {
537537
console.log("Using _searchWithGraph() method");
538538

539539
this.props.context.msGraphClientFactory
540-
.getClient()
541-
.then((client: MSGraphClient) => {
540+
.getClient('3')
541+
.then((client: MSGraphClientV3) => {
542542
// From https://github.com/microsoftgraph/msgraph-sdk-javascript sample
543543
client
544544
.api("users")
@@ -575,7 +575,7 @@ private _searchWithGraph = () : void => {
575575
}
576576
```
577577

578-
You get an instance of the `MSGraphClient` type by calling the `context.msGraphClientFactory.getClient()` method.
578+
You get an instance of the `MSGraphClientV3` type by calling the `context.msGraphClientFactory.getClient('3')` method.
579579

580580
You then use the fluent API of the Microsoft Graph SDK to define the OData query that runs against the target Microsoft Graph endpoint.
581581

0 commit comments

Comments
 (0)