Skip to content
This repository has been archived by the owner on Sep 16, 2020. It is now read-only.

josefaidt/nWeather

Repository files navigation

nWeather

dependencies dev dependencies License

Not another Weather API

nWeather is a GraphQL wrapper for the OpenWeatherMap REST endpoint. Visit the ZEIT deployment

Examples

Current Weather

Browse by City Name

query {
  currentWeather(city: "Baton Rouge") {
    name
    weather {
      main
      description
    }
    main {
      temp
    }
  }
}

Browse by ZIP

query {
  currentWeather(zip: 70802) {
    name
    weather {
      main
      description
    }
    main {
      temp
    }
  }
}

Browse by Coordinates

query {
  currentWeather(coords: { lat: 30.44, lon: -91.17 }) {
    name
    weather {
      main
      description
    }
    main {
      temp
    }
  }
}

Forecast

Forecast list is in 3-hour intervals (i.e. limit: 3 returns 3 sets of data across a 9 hour span)

Browse by ZIP

query {
  forecast(zip: 70802, limit: 3) {
    cnt
    list {
      main {
        temp
        humidity
        pressure
        sea_level
        temp_min
        temp_max
      }
      weather {
        main
        description
        id
        icon
      }
      dt
      dt_txt
      wind {
        speed
        deg
      }
    }
  }
}

About

A GraphQL wrapper for the OpenWeatherMap REST API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published