import { client } from '@operato/graphql';
import gql from 'graphql-tag';
import { showToast } from '../../shared/utils/alert';
export const QUERY_POWER_PLANT_STATE_BY_YEAR_MONTH = `
  powerPlantStateByYearMonth(yearMonth: $yearMonth) {
    maxDemand
    feeApplyPower
  }
`;
export const getPowerPlantStateByYearMonth = async (yearMonth) => {
    const response = await client.query({
        query: gql `
      query PowerPlantStateByYearMonth($yearMonth: String!) {
        powerPlantStateByYearMonth(yearMonth: $yearMonth) {
          date
          electricityFeeType
          basicFeeUnitPrice
          basicFee
          feeApplyPower
          feeApplyPowerDate
          maxDemand
          maxDemandDate
          usageFeeInSpringLight
          usageFeeInSpringMid
          usageFeeInSpringMax
          usageFeeInSummerLight
          usageFeeInSummerMid
          usageFeeInSummerMax
          usageFeeInWinterLight
          usageFeeInWinterMid
          usageFeeInWinterMax
        }
      }
    `,
        variables: {
            yearMonth
        }
    });
    if (response.errors) {
        showToast('요청에 실패하였습니다');
        return { status: false, data: {} };
    }
    return {
        status: true,
        data: response.data.powerPlantStateByYearMonth
    };
};
//# sourceMappingURL=query.js.map