Code Monkey home page Code Monkey logo

pikud-haoref-api-graphql's Introduction

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

pikud-haoref-api-graphql's People

Contributors

tuvalsimha avatar

Stargazers

 avatar Gil Gardosh avatar Niv daivd avatar Moris Maor Zakay avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.