src/schema/utils/index.js
function getRemoteMethodOutput(method) {

    let returnType = 'JSON';
    let list = false;

    if (method.returns && method.returns[0]) {
        if (!SCALARS[method.returns[0].type] && typeof method.returns[0].type !== 'object') {
            returnType = `${method.returns[0].type}`;
        } else {
            returnType = `${method.returns[0].type}`;
            if (_.isArray(method.returns[0].type) && _.isString(method.returns[0].type[0])) {
                returnType = method.returns[0].type[0];
                list = true;
            } else if (typeof method.returns[0].type === 'object') {
                returnType = 'JSON';
            }
        }
    }

    let type = exchangeTypes[returnType] || returnType;
    type = (list) ? getConnection(type) : getType(type);
    type = type || getType('JSON');

    return {
        type,
        list
    };
}
function getRemoteMethodOutput(method) {

    let returnType = 'JSON';
    let list = false;

    if (method.returns && method.returns[0]) {
        if (!SCALARS[method.returns[0].type] && typeof method.returns[0].type !== 'object') {
            returnType = `${method.returns[0].type}`;
        } else {
            returnType = `${method.returns[0].type}`;
            if (_.isArray(method.returns[0].type) && _.isString(method.returns[0].type[0])) {
                returnType = method.returns[0].type[0];
                list = true;
            } else if (typeof method.returns[0].type === 'object') {
                returnType = 'JSON';
            }
        }
    }

    let type = exchangeTypes[returnType] || returnType;
    type = (list) ? getConnection(type) : getType(type);
    type = type || getType('JSON');

    return {
        type,
        list
    };
}
function getRemoteMethodOutput ( method ) { let returnType = 'JSON' ; let list = false ; if ( method . returns && method . returns [ 0 ] ) { if ( ! SCALARS [ method . returns [ 0 ] . type ] && typeof method . returns [ 0 ] . type !== 'object' ) { returnType = ` ${ method . returns [ 0 ] . type } ` ; } else { returnType = ` ${ method . returns [ 0 ] . type } ` ; if ( _ . isArray ( method . returns [ 0 ] . type ) && _ . isString ( method . returns [ 0 ] . type [ 0 ] ) ) { returnType = method . returns [ 0 ] . type [ 0 ] ; list = true ; } else if ( typeof method . returns [ 0 ] . type === 'object' ) { returnType = 'JSON' ; } } } let type = exchangeTypes [ returnType ] || returnType ; type = ( list ) ? getConnection ( type ) : getType ( type ) ; type = type || getType ( 'JSON' ) ; return { type , list } ; }
Extracts query output fields from a remote method
@param {*} method
Extracts query output fields from a remote method