How to use the @webiny/commodo-graphql.ListResponse function in @webiny/commodo-graphql

To help you get started, we’ve selected a few @webiny/commodo-graphql examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github webiny / webiny-js / packages / api-cms / src / utils / resolveList.js View on Github external
export const resolveList = ({ model }: Object) => async (
    entry: any,
    args: Object,
    context: Object,
    info: Object
) => {
    try {
        const { entries, meta } = await findEntries({ model, args, context, info });
        return new ListResponse(entries, meta);
    } catch (err) {
        return new ListErrorResponse({ code: err.code || "RESOLVE_LIST", error: err.message });
    }
};