import { client } from '@operato/graphql';
import gql from 'graphql-tag';
import { showToast } from '../../shared/utils/alert';
export const getLastCarbonCreditPriceByType = async (type) => {
    const response = await client.query({
        query: gql `
      query LastCarbonCreditPriceByType($type: String!) {
        lastCarbonCreditPriceByType(type: $type) {
          id
          type
          closingPrice
          volume
          date
        }
      }
    `,
        variables: { type }
    });
    if (response.errors) {
        showToast('요청에 실패하였습니다');
        return { status: false, data: [] };
    }
    return {
        status: true,
        data: response.data.lastCarbonCreditPriceByType
    };
};
//# sourceMappingURL=query.js.map