@@ -252,7 +252,7 @@ Now you can update the **GraphConsumer** React component under the **./src/webpa
252
252
} from "office-ui-fabric-react";
253
253
import * as React from "react";
254
254
255
- import { AadHttpClient, MSGraphClient } from "@microsoft/sp-http";
255
+ import { AadHttpClient, MSGraphClientV3 } from "@microsoft/sp-http";
256
256
import { escape } from "@microsoft/sp-lodash-subset";
257
257
258
258
import { ClientMode } from "./ClientMode";
@@ -453,11 +453,11 @@ When you package and deploy your solution, you (or an admin) will have to grant
453
453
You can now implement the methods to consume the Microsoft Graph . You have two options :
454
454
455
455
- Use the ** AadHttpClient ** client object
456
- - Use the ** MSGraphClient ** client object
456
+ - Use the ** MSGraphClientV3 ** client object
457
457
458
458
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 .
459
459
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 .
461
461
462
462
### Using AadHttpClient
463
463
@@ -524,9 +524,9 @@ private _searchWithAad = (): void => {
524
524
525
525
The ` get() ` method gets the URL of the OData request as the input argument. A successful request returns a JSON object with the response.
526
526
527
- ### Using MSGraphClient
527
+ ### Using MSGraphClientV3
528
528
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.
530
530
531
531
The following example shows the implementation of the ` _searchWithGraph() ` method of the sample solution.
532
532
@@ -537,8 +537,8 @@ private _searchWithGraph = () : void => {
537
537
console .log (" Using _searchWithGraph() method" );
538
538
539
539
this .props .context .msGraphClientFactory
540
- .getClient ()
541
- .then ((client : MSGraphClient ) => {
540
+ .getClient (' 3 ' )
541
+ .then ((client : MSGraphClientV3 ) => {
542
542
// From https://github.com/microsoftgraph/msgraph-sdk-javascript sample
543
543
client
544
544
.api (" users" )
@@ -575,7 +575,7 @@ private _searchWithGraph = () : void => {
575
575
}
576
576
```
577
577
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.
579
579
580
580
You then use the fluent API of the Microsoft Graph SDK to define the OData query that runs against the target Microsoft Graph endpoint.
581
581
0 commit comments