withPersistedQuery

Returns a copy of this request with a persisted query extension added.

The extension follows the Apollo persisted query protocol: extensions.persistedQuery = { version, sha256Hash }. Adding the extension never mutates this instance; the original request keeps its extensions unchanged.

Return

A new request whose extensions contain the persisted query entry.

Parameters

sha256Hash

The SHA-256 hex digest of the GraphQL document.

version

The protocol version, defaulting to 1.