{"size": 1259, "ext": "js", "max_stars_repo_path": "src/resolvers/Bid.js", "max_stars_repo_name": "blackspider1994/api-plugin-bidding", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/resolvers/Bid.js", "max_issues_repo_name": "blackspider1994/api-plugin-bidding", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/resolvers/Bid.js", "max_forks_repo_name": "blackspider1994/api-plugin-bidding", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 29.2790697674, "max_line_length": 64, "alphanum_fraction": 0.5957108817}
import getVariantbyId from "../utils/getVariantbyId.js";
import getAccountById from "../utils/getAccountById.js";
export default {
//   Bid: {
    async product(parent, args, context, info) {
      console.log("bid product called",parent);
      let cat_product=await getVariantbyId(context,parent);
      return cat_product;
    },

    async createdByinfo(parent, args, context, info) {
      let account=await getAccountById(context,parent.createdBy)
      return {
        name: account.username
          ? account.username
          : account.profile.username
          ? account.profile.username
          : account.name
          ? account.name
          : account.profile.name
          ? account.profile.name
          : "LoS",
        image: account.profile.picture,
      };
    },
    async soldByInfo(parent, args, context, info) {
      let account= await getAccountById(context,parent.soldBy)
      return {
       name: account.username
          ? account.username
          : account.profile.username
          ? account.profile.username
          : account.name
          ? account.name
          : account.profile.name
          ? account.profile.name
          : "LoS",
        image: account.profile.picture,
      };
    },
//   },
};
