Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
Practical SharePoint Framework (SPFx) Development

You're reading from   Practical SharePoint Framework (SPFx) Development Build modern, scalable, and efficient business solutions for SharePoint and Microsoft 365

Arrow left icon
Product type Paperback
Published in Jun 2025
Publisher Packt
ISBN-13 9781835466780
Length 442 pages
Edition 1st Edition
Languages
Arrow right icon
Authors (2):
Arrow left icon
Franck Cornu Franck Cornu
Author Profile Icon Franck Cornu
Franck Cornu
Anoop T. Anoop T.
Author Profile Icon Anoop T.
Anoop T.
Arrow right icon
View More author details
Toc

Table of Contents (29) Chapters Close

Preface 1. Part 1: Getting Started with the SharePoint Framework
2. Chapter 1: Introducing Microsoft 365 and SharePoint Online for Developers FREE CHAPTER 3. Chapter 2: Ecosystem and Building Blocks around the SharePoint Framework 4. Chapter 3: Your First Steps with the SharePoint Framework 5. Chapter 4: Packt Product Management Solution: A Practical Use Case 6. Part 2: Building Web Parts with the SharePoint Framework
7. Chapter 5: Building a SharePoint Web Part 8. Chapter 6: Working with the Property Pane 9. Chapter 7: Connecting to Other Web Parts 10. Chapter 8: Deploying a SharePoint Web Part 11. Part 3: Building Extensions with the SharePoint Framework
12. Chapter 9: Building a Form Customizer 13. Chapter 10: Building an Application Customizer 14. Chapter 11: Building a Field Customizer 15. Chapter 12: Building a ListView Command Set 16. Chapter 13: Building a Search Query Modifier 17. Chapter 14: Building an Adaptive Card Extension 18. Chapter 15: Deploying Extensions 19. Part 4: Going Further with the SharePoint Framework
20. Chapter 16: Sharing Your Code Using Library Components 21. Chapter 17: Debugging Your Solution Efficiently 22. Chapter 18: Consuming APIs 23. Chapter 19: Writing Tests with SPFx 24. Chapter 20: Upgrading Your Solutions 25. Chapter 21: Leveraging Community Tools and Libraries 26. Chapter 22: Development Platforms 27. Index 28. Other Books You May Enjoy

Using the Microsoft Graph API

In Chapter 5, we demonstrated how to use the Microsoft Graph API to fetch a list of products coming from a SharePoint list in the ProductCatalogService class. In this section, we will simply summarize all the important steps.

As explained in the previous section, the very first step before calling the Microsoft Graph API is to approve the API permission scopes needed for the requested operation. In our case, we declare and approve the Sites.Read.All API permission.

Then, to perform requests against the Microsoft Graph API from an SPFx component, we need to get a client for the Microsoft Graph API to be able to make calls. We use the msGraphClientFactory.getClient("3") method from the this.context SPFx property to get one:

..
const msGraphClient = await this.context.msGraphClientFactory.getClient("3");
..

Finally, using that client instance, we use the appropriate /sites/{site-id}/lists/{list-id}/items endpoint URL and the...

lock icon The rest of the chapter is locked
Visually different images
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Practical SharePoint Framework (SPFx) Development
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Modal Close icon
Modal Close icon