Dry Run
Test Payload create operations end-to-end without persisting, by rolling back the transaction after hooks and validation run.
Installation
pnpm add @lizardglobal/payload-dry-run About
Payload Dry Run lets you exercise a collection's `create` operation all the way through validation, hooks, and access control, then throws the write away. The full pipeline runs as if the document were being committed, so anything that would reject or transform the request still fires. Only the final database commit is undone, via `req.payload.db.rollbackTransaction(req.transactionID)` inside an `afterOperation` hook. You enable it per collection with `dryRunCreatePlugin({ collections: ['users', 'orders'] })`. A dry run is triggered by passing a truthy flag (default `_dryRun`) through the query string, request body, search params, or `req.context`. Truthy values include `true`, `1`, `"on"`, `"yes"`, and `"true"`, case-insensitive. The flag is also written back into `req.context` so downstream hooks can detect it. The `dryRunFieldName` option accepts a single shared name, a per-collection object, or an object with a `_default` fallback. For auth collections with email verification, a `beforeOperation` hook sets `disableVerificationEmail: true` so a dry run does not send verification mail. A `disabled` flag skips the plugin entirely, useful for keeping it off in production. A `withCreateDryRun(collection, fieldName?)` helper applies the same behavior to a single `CollectionConfig` without going through the plugin, for cases where you compose collection configs manually. The helper is idempotent. If a rollback is needed but no `transactionID` is present, the plugin throws rather than silently leaving a committed document. The project marks itself experimental, with APIs and schema still subject to change.
Package info
- Package name
@lizardglobal/payload-dry-run- Latest version
1.0.1- Unpacked size
- 35 kB
- License
- MIT
- Weekly downloads
- 197
- Last publish
- Jul 28, 2026
More from LizardGlobalGH
View profileRich Text Lexical React Native
Renders serialized Lexical rich text from Payload CMS in React Native apps using native primitives with overridable converters.
Discord Sync
Syncs Discord guilds, channels, members, and roles into Payload collections on demand, over HTTP, or on a cron schedule via discord.js.
Similar plugins
More in Devtoolspayload-cli
CLI for direct access to PayloadCMS data for AI agents and humans.
agent API guide
Generate a live API reference and query guide for Payload CMS.
Markdown documentation sync
Syncs Markdown documentation with Payload CMS using Git.
OpenAPI
Generates OpenAPI specifications from Payload CMS configurations.
Puck visual page builder
Integrate Puck visual page builder with Payload CMS for drag-and-drop editing.
Resolve alias webpack helper
Payload plugin that injects webpack resolve aliases to stub out server-only modules in the admin bundle.