spacer
Skip to content

@pnp/graph/items

Currently, there is no module in graph to access all items directly. Please, instead, default to search by path using the following methods.

Selective Imports Banner

Get list items

import { Site } from "@pnp/graph/sites";

const sites = graph.sites.getById("{site id}");

const items = await Site(sites, "lists/{listid}/items")();

Get File/Item version information

import { Site } from "@pnp/graph/sites";

const sites = graph.sites.getById("{site id}");

const users = await Site(sites, "lists/{listid}/items/{item id}/versions")();

Get list items with fields included

import { Site } from "@pnp/graph/sites";
import "@pnp/graph/lists";

const sites = graph.sites.getById("{site id}");

const listItems : IList[] = await Site(sites, "lists/{site id}/items?$expand=fields")();