import { getPayload } from 'payload'; import config from '@payload-config'; import type { Payload } from 'payload'; /** * One Payload instance per process. getPayload() is itself memoised by * Payload, but routing every caller through here keeps the config import in a * single place and gives page code one name to mock in tests. * * Never call this at module scope: CI builds the image with no database * reachable, so a build-time connection attempt fails the build. */ export function getCachedPayload(): Promise { return getPayload({ config }); }