import { NODE_TYPES } from 'common/enums' ; import { toGlobalId } from 'common/utils' ; import { GQLAppreciationTypeResolver , GQLCryptoWalletTypeResolver , GQLFollowingActivityTypeResolver , GQLFollowingTypeResolver , GQLLikerTypeResolver , GQLPossibleFollowingActivityTypeNames , GQLQueryTypeResolver , GQLRecommendationTypeResolver , GQLStripeAccountTypeResolver , GQLTransactionTargetTypeResolver , GQLTransactionTypeResolver , GQLUserActivityTypeResolver , GQLUserInfoTypeResolver , GQLUserOSSTypeResolver , GQLUserSettingsTypeResolver , GQLUserStatusTypeResolver , GQLUserTypeResolver , GQLWalletTypeResolver , } from 'definitions' ; import { Appreciation } from './appreciation' ; import articleCount from './articleCount' ; import avatar from './avatar' ; import badges from './badges' ; import blockList from './blockList' ; import commentCount from './commentCount' ; import cryptoWallet from './cryptoWallet' ; import donatedArticleCount from './donatedArticleCount' ; import followers from './followers' ; import Following from './following' ; import group from './group' ; import hasPaymentPassword from './hasPaymentPassword' ; import isBlocked from './isBlocked' ; import isBlocking from './isBlocking' ; import isFollowee from './isFollowee' ; import isFollower from './isFollower' ; import Liker from './liker' ; import likerId from './liker/likerId' ; import { hasNFTs , nfts } from './nfts' ; import notification from './notification' ; import { boost , score } from './oss' ; import ownCircles from './ownCircles' ; import profileCover from './profileCover' ; import receivedDonationCount from './receivedDonationCount' ; import Recommendation from './recommendation' ; import rootUser from './rootUser' ; import StripeAccount from './stripeAccount' ; import subscribedCircles from './subscribedCircles' ; import subscriptions from './subscriptions' ; import totalWordCount from './totalWordCount' ; import { Transaction , TransactionTarget } from './transaction' ; import unreadFollowing from './unreadFollowing' ; import unreadNoticeCount from './unreadNoticeCount' ; import UserActivity from './userActivity' ; import userNameEditable from './userNameEditable' ; import Wallet from './wallet' ; const user = { Query : { viewer : ( root , _ , { viewer } ) => viewer , user : rootUser , } , User : { id : ( { id } ) => ( id ? toGlobalId ( { type : NODE_TYPES . User , id } ) : '' ) , avatar , likerId , liker : ( root ) => root , info : ( root ) => root , wallet : ( root ) => root , settings : ( root ) => root , status : ( root ) => ( root . id ? root : null ) , activity : ( root ) => root , following : ( root ) => root , recommendation : ( root ) => root , oss : ( root ) => root , subscriptions , followers , isFollower , isFollowee , blockList , isBlocking , isBlocked , ownCircles , subscribedCircles , } , UserInfo : { badges , userNameEditable , email : ( { email } ) => email && email . replace ( /#/g , '@' ) , profileCover , group , cryptoWallet , } , UserSettings : { language : ( { language } , _ , { viewer } ) => language , notification , } , UserActivity , UserStatus : { articleCount , commentCount , unreadNoticeCount , unreadFollowing , hasPaymentPassword , totalWordCount , donatedArticleCount , receivedDonationCount , } , Appreciation , Following , FollowingActivity : { __resolveType : ( { __type , } ) => __type , } , Recommendation , Liker , UserOSS : { boost , score , } , Wallet , Transaction , TransactionTarget , StripeAccount , CryptoWallet : { id : ( { id } ) => id ? toGlobalId ( { type : NODE_TYPES . CryptoWallet , id } ) : '' , address : ( { address } ) => address , createdAt : ( { createdAt } ) => createdAt , hasNFTs , nfts , } , } ; export default user ;