src/schema/query/viewer.js
function getMeField(User) {

    return {
        me: {
            type: getType(User.modelName),
            resolve: (obj, args, { app, req }) => {

                if (!req.accessToken) return null;

                return findUserFromAccessToken(req.accessToken, User);
            }
        }
    };
}
function getMeField(User) {

    return {
        me: {
            type: getType(User.modelName),
            resolve: (obj, args, { app, req }) => {

                if (!req.accessToken) return null;

                return findUserFromAccessToken(req.accessToken, User);
            }
        }
    };
}
function getMeField ( User ) { return { me : { type : getType ( User . modelName ) , resolve : ( obj , args , { app , req } ) => { if ( ! req . accessToken ) return null ; return findUserFromAccessToken ( req . accessToken , User ) ; } } } ; }
Create a me field for a given user model
@param {*} User
Create a me field for a given user model