sharepoint online – how to fetch all Planner Task in SPFX through Graph API

As per the documentation at: plannerTask resource type, sample response for planner task will be like:

{
  "activeChecklistItemCount": 1024,
  "appliedCategories": {"@odata.type": "microsoft.graph.plannerAppliedCategories"},
  "assigneePriority": "String",
  "assignments": {"@odata.type": "microsoft.graph.plannerAssignments"},
  "bucketId": "String",
  "checklistItemCount": 1024,
  "completedBy": {"@odata.type": "microsoft.graph.identitySet"},
  "completedDateTime": "String (timestamp)",
  "conversationThreadId": "String",
  "createdBy": {"@odata.type": "microsoft.graph.identitySet"},
  "createdDateTime": "String (timestamp)",
  "dueDateTime": "String (timestamp)",
  "hasDescription": true,
  "id": "String (identifier)",
  "orderHint": "String",
  "percentComplete": 1024,
  "planId": "String",
  "previewType": "String",
  "referenceCount": 1024,
  "startDateTime": "String (timestamp)",
  "title": "String"
}

Which has title in it. Also, I tried it using Graph explorer and I am able to see the title of planner task like:

enter image description here

So, my guess the issue is with your data type of messages array you mentioned: MicrosoftGraph.Message().

Check the correct data type of planner task (from Microsoft graph library) and use it OR

Create a props with the required properties you need from planner task and use it like given at: SPFx sample – personalTasks