Skip to content

TuvalSimha/pikud-haoref-api-graphql

Repository files navigation

Pikud HaOref GraphQL API

This GraphQL API provides access to alerts data related to Pikud HaOref red alerts history.

live

Usage

You can interact with this API by sending GraphQL queries to the provided endpoint.

Endpoint

Live Query URL: https://pikud-haoref-graphql-api.tuval-simha.workers.dev/graphql

Example Queries

Get all alerts from today:

query AllAlertsFromToday {
    allAlertsFromToday(orderBy: CREATED_AT_DESC, first: 10) {
        edges {
            node {
                category
                date
                location
                title
            }
            cursor
        }
        pageInfo {
            hasNextPage
            endCursor
        }
    }
}

Get all alerts from last week:

query AllAlertsFromLastWeek {
    allAlertsFromLastWeek(orderBy: CREATED_AT_DESC, first: 10) {
        edges {
            node {
                category
                date
                location
                title
            }
            cursor
        }
        pageInfo {
            hasNextPage
            endCursor
        }
    }
}

Get all alerts from last month:

query AllAlertsFromLastMonth {
    allAlertsFromLastMonth(orderBy: CREATED_AT_DESC, first: 10) {
        edges {
            node {
                category
                date
                location
                title
            }
            cursor
        }
        pageInfo {
            hasNextPage
            endCursor
        }
    }
}

Get all alerts by date range:

  • Make sure to insert the date in the format: DD.MM.YYYY
query AllAlertsByDateRange($fromDateTime: DateTime, $toDateTime: DateTime) {
    allAlertsByDateRange(dates: { fromDateTime: $fromDateTime, toDateTime: $toDateTime }, first: 10) {
        edges {
            node {
                category
                date
                location
                title
            }
            cursor
        }
        pageInfo {
            hasNextPage
            endCursor
        }
    }
}

Pagination

For all queries, pagination is supported using the first and after arguments. The first argument determines the number of items to return per page, and the after argument is used to paginate through the result set.

  • first: Specifies the number of items to return per page.
  • after: Indicates the cursor to start paginating from.

Filtering

You can filter alerts based on their type using the typeBy argument. This allows you to retrieve alerts of specific types only. The available types are:

  • MISSILES
  • UAV_INTRUSION
  • EARTH_QUAKE
  • RADIO_LOGICAL_EVENT
  • TSUNAMI
  • HAZARDOUS_MATERIALS
  • TERRORIST_INFILTRATION
  • DRILL_MISSILES
  • DRILL_GENERAL
  • DRILL_EARTH_QUAKE
  • DRILL_RADIO_LOGICAL_EVENT
  • DRILL_TSUNAMI
  • DRILL_UAV_INTRUSION
  • DRILL_HAZARDOUS_MATERIALS
  • DRILL_TERRORIST_INFILTRATION

Make sure to pass the desired type as an argument when querying for alerts.

Contributing

This repository is open-source, and contributions are welcome! If you'd like to contribute, please fork the repository, make your changes, and submit a pull request. Appreciate your help in improving this project!

If you find this project helpful and would like to support its development, consider buying me a coffee:

Buy Me A Coffee

About

This GraphQL API provides access to alerts data related to Pikud HaOref red alerts history.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published