Skip to content

payload-schema — Optimization

A plain pick(keys) makes all picked keys required. Set the optional option when the projection should respect optional fields.

Reserve id, blockName and blockType in block definitions. Reusing those names throws INVALID_FIELD_CONFIGURATION.

Use the universal root entry for shared schemas. Import the ./payload compiler only in Node.js Payload configuration.

Custom schema transforms are not codec-safe for z.encode. Use .refine() or .overwrite() when schemas serve as operation outputs.

Package guidance · Implementation. · Matching skill.