Microsoft Graph SDK for JavaScript Release Notes

Darrel Miller

We recently updated our JavaScript Graph SDK to version 1.4.0 and our Typescript Graph Types package to 1.6.0. The SDK release includes several new features and some bug fixes. The Typescript types includes updates to the models for Teams and Devices.

Page Iterator

Often collections of entities are split into pages and each page is returned with a URL to the next page.  The PageIterator class simplifies consuming paged collections.  Simply provide a callback method that will operate on each item in the paged collection and call the Iterate method.  The PageIterator class will take care of following the NextLinks for you.

Iterate over all the messages

async function callingPattern() {
  try {
	// Makes request to fetch mails list. Which is expected to have multiple pages of data.
	let response: PageCollection = await client.api("/me/messages").get();

	// A callback function to be called for every item in the collection. This call back should return boolean indicating whether not to continue the iteration process.
	let callback: PageIteratorCallback = (data) => {
		return true;

	// Creating a new page iterator instance with client a graph client instance, page collection response from request and callback
	let pageIterator = new PageIterator(client, response, callback);

	// This iterates the collection until the nextLink is drained out.
  } catch (e) {
	throw e;

If you want to stop the iterator before it iterates through the entire collection, you can simply return false from the callback.

Added Search query param functionality

Use the .search() function to perform a free text search over a collection of entities.

try {
	let res = await client
} catch (error) {
	throw error;

Bug Fixes:

JavaScript SDK

Typescript Graph Types

Feedback usabilla icon