Fetch US weather forecast data for multiple locations

This query connects to US National Weather Service's API and retrieves the weather forecast data for the multiple locations with given coordinates (via variable $coordinatesList, which is a list of JSON objects with entries lat and long).

query GenerateLocationURLs(
# List of JSON objects with entries `lat` and `long`
# eg: [ { "lat": 39.7456, "long": -97.0892 }, { "lat": 34.7456, "long": -77.0892 } ]
$coordinatesList: [JSONObject!]!
) {
coordinatesList: _echo(value: $coordinatesList)
passValueOnwardsAs: "coordinates"
affectDirectivesUnderPos: [1, 2, 3, 4]
name: "_objectProperty",
arguments: {
by: { key: "lat" }
object: $coordinates
passOnwardsAs: "lat"
name: "_objectProperty",
arguments: {
by: { key: "long" }
object: $coordinates
passOnwardsAs: "long"
name: "_sprintf",
arguments: {
string: "https://api.weather.gov/points/%s,%s",
values: [$lat, $long]
passOnwardsAs: "locationURL"
name: "_echo",
arguments: {
value: {
url: $locationURL
setResultInResponse: true
@export(as: "coordinatesListInput")

query FetchUSWeatherDataForLocations
@depends(on: "GenerateLocationURLs")
_sendJSONObjectItemHTTPRequests(inputs: $coordinatesListInput)

Extensions required for this query permalink

  1. Field on Field permalink

    Manipulate the value of a field by applying some other field on it.

  2. Field To Input permalink

    Retrieve the value of a field, manipulate it, and input it into another field or directive, all within the same operation.

  3. Field Value Iteration and Manipulation permalink

    Iterate and manipulate the value elements of array and object fields.

  4. HTTP Client permalink

    Addition of fields to execute HTTP requests against a webserver and fetch their response.

  5. Multiple Query Execution permalink

    Combine multiple queries into a single query, sharing state across them and executing them in the requested order.

  6. PHP Functions via Schema permalink

    Manipulate the field output using standard programming language functions available in PHP.

Bundles containing all extensions required for this query permalink

  1. “All in One Toolbox for WordPress” Bundle permalink

    Achieve all superpowers: All of Gato GraphQL extensions, in a single plugin

  2. “Automated Content Translation & Sync for WordPress Multisite” Bundle permalink

    Automatically create a translation of a newly-published post using the Google Translate API, for every language site on a WordPress multisite

  3. “Better WordPress Webhooks” Bundle permalink

    Easily create webhooks to process incoming data from any source or service using advanced tools, directly within the wp-admin

  4. “Private GraphQL Server for WordPress” Bundle permalink

    Use GraphQL to power your application (blocks, themes and plugins), internally fetching data without exposing a public endpoint

  5. “Selective Content Import, Export & Sync for WordPress” Bundle permalink

    Import hundreds of records into your WordPress site from another site or service (such as Google Sheets), and selectively export entries to another site

  6. “Tailored WordPress Automator” Bundle permalink

    Create workflows to automate tasks (to transform data, automatically caption images, send notifications, and more)

  7. “Versatile WordPress Request API” Bundle permalink

    Interact with any external API and cloud service, posting and fetching data to/from them

Tutorial lessons explaining how the query works permalink