import { client } from '@operato/graphql';
import gql from 'graphql-tag';
import { showToast } from '../../utils/alert';
export const getCityWeather = async () => {
    const response = await client.query({
        query: gql `
      query OpenWeatherCities {
        openWeatherCities {
          items {
            id
            cityName
            cityId
            weather
          }
        }
      }
    `
    });
    if (response.errors) {
        showToast('요청에 실패하였습니다');
        throw new Error('요청에 실패하였습니다');
    }
    return response.data.openWeatherCities;
};
export const getFineDust = async () => {
    const response = await client.query({
        query: gql `
      query OdCloudDust {
        odCloudDust {
          dustState
        }
      }
    `
    });
    if (response.errors) {
        showToast('요청에 실패하였습니다');
        throw new Error('요청에 실패하였습니다');
    }
    return {
        status: true,
        data: response.data.odCloudDust.dustState
    };
};
//# sourceMappingURL=weather.js.map