import { environment } from 'common/environment' ; import { LikerToLikerIdResolver } from 'definitions' ; const resolver = async ( { likerId } , _ , { viewer , dataSources : { userService } } ) => { if ( ! likerId ) { return null ; } const liker = await userService . findLiker ( { likerId } ) ; const isFromLikeCoinOAuthClient = viewer . oauthClient && viewer . oauthClient . name === environment . likecoinOAuthClientName ; if ( liker && ( isFromLikeCoinOAuthClient || liker . accountType === 'general' ) ) { return likerId ; } return null ; } ; export default resolver ;