I am using render function to make Graph Api call
I have created a function _outlookTask to fetch the outlook task's data
How to make Graph Api call with Selecting the HTTP method as GET and then, select beta as the API version in my function
public render(): void {
this.context.msGraphClientFactory
.getClient()
.then((graphclient:MSGraphClient): void=>{
graphclient
.api('/me/outlook/tasks')
.get((error,user:MicrosoftGraph.OutlookItem,rawResponse?:any)=>{
this.domElement.innerHTML = `
<div>
<div id="spListContainer">
</div>
</div>`;
this._OutlookTask(tasks.value)
})
})
}
private _OutlookTask(tasks: MicrosoftGraph.Message[]): void {
let html: string = '';
for (let index = 0; index < tasks.length; index++) {
html += `<p class="${styles.description}">Tasks Through Outlook ${index + 1} -
${escape(tasks[index].subject)}</p>`;
}
// Add the emails to the placeholder
const listContainer: Element = this.domElement.querySelector('#spListContainer');
listContainer.innerHTML = html;
}