Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
31 lines
1.2 KiB
Plaintext
31 lines
1.2 KiB
Plaintext
import { findVersionsOperationGlobal, isolateObjectProperty } from 'payload';
|
|
import { buildSelectForCollectionMany } from '../../utilities/select.js';
|
|
export function findVersions(globalConfig) {
|
|
return async function resolver(_, args, context, info) {
|
|
const req = context.req = isolateObjectProperty(context.req, [
|
|
'locale',
|
|
'fallbackLocale',
|
|
'transactionID'
|
|
]);
|
|
const select = context.select = args.select ? buildSelectForCollectionMany(info) : undefined;
|
|
req.locale = args.locale || req.locale;
|
|
req.fallbackLocale = args.fallbackLocale || req.fallbackLocale;
|
|
req.query = req.query || {};
|
|
const { sort } = args;
|
|
const options = {
|
|
depth: 0,
|
|
globalConfig,
|
|
limit: args.limit,
|
|
page: args.page,
|
|
pagination: args.pagination,
|
|
req,
|
|
select,
|
|
sort: sort && typeof sort === 'string' ? sort.split(',') : undefined,
|
|
where: args.where
|
|
};
|
|
const result = await findVersionsOperationGlobal(options);
|
|
return result;
|
|
};
|
|
}
|
|
|
|
//# sourceMappingURL=findVersions.js.map |