Skip to content


The Queryable class is the base class for all of the libraries building fluent request apis.

abstract class ODataQueryable<BatchType extends ODataBatch>

This class takes a single type parameter representing the type of the batch implementation object. If your api will not support batching you can create a dummy class here and simply not use the batching calls.



Provides access to the query string builder for this url

Public Methods


Directly concatenates the supplied string to the current url, not normalizing "/" chars


Sets custom options for current object and all derived objects accessible via chaining

import { ConfigOptions } from "@pnp/queryable";
import { sp } from "@pnp/sp";

const headers: ConfigOptions = {
    Accept: 'application/json;odata=nometadata'

// here we use configure to set the headers value for all child requests of the list instance
const list = sp.web.lists.getByTitle("List1").configure({ headers });

// this will use the values set in configure
list.items().then(items => console.log(JSON.stringify(items, null, 2));

For reference the ConfigOptions interface is shown below:

export interface ConfigOptions {
    headers?: string[][] | { [key: string]: string } | Headers;
    mode?: "navigate" | "same-origin" | "no-cors" | "cors";
    credentials?: "omit" | "same-origin" | "include";
    cache?: "default" | "no-store" | "reload" | "no-cache" | "force-cache" | "only-if-cached";


Sets custom options from another queryable instance's options. Identical to configure except the options are derived from the supplied instance.


Enables caching for this request. See caching for more details.

import { sp } from "@pnp/sp"



Adds this query to the supplied batch


Gets the current url

abstract toUrlAndQuery()

When implemented by an inheriting class will build the full url with appropriate query string used to make the actual request


Execute the current request. Takes an optional type parameter allowing for the typing of the value or the user of parsers that will create specific object instances.