Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export const listPublishedPages = async ({ args, context }: Object) => {
const plugin = context.plugins.byName("pb-resolver-list-published-pages");
if (!plugin) {
throw Error(`Resolver plugin "pb-resolver-list-published-pages" is not configured!`);
}
const { pages, totalCount } = await plugin.resolve({ args, context });
const meta = createPaginationMeta({
totalCount,
page: args.page,
perPage: args.perPage
});
return new Collection(pages).setMeta(meta);
};