Using the Microsoft Graph API to get items
Commit reference
Please refer to the https://github.com/PacktPublishing/Mastering-SharePoint-Development-with-the-SharePoint-Framework-/commit/9287d2f1e7978393ab41903669828f677d0c07fb commit for more details on the exact changes.
Now that we can display text in a React component of the application customizer, the next step needed to meet the requirements is to query the Products list to check whether there are any products that are low in stock (i.e., below 10). If that is the case, then we will show the React component with the names of the products that are low in stock.
Filtering items
We can use the Microsoft Graph API to filter the items from a SharePoint list. This can be done by passing a filter clause to the /items endpoint (which gets the items list).
In our case, we need to filter those products from the Products list whose Stock Level is less than 10. So, the filter clause will be fields/packtProductStockLevel lt...