Home

Awesome

GitQL

Polkadot binary updater with Github GraphQL API v4, JQ, CURL and without Git

A basic script that will check the latest Polkadot release TAG version commited and it's status as "Latest, Draft, Pre-Release" if all the conditions are fulfilled it will do a secondary check if a binary file exist, then it will download, backup, restart and wait to see the application status.

Outputs are outputed to the journald, will suggest "Grafana, Loki and Promtail".

Dependencies:

Steps:

Others:

import Head from 'next/head'
import { setContext } from '@apollo/client/link/context';
import { ApolloClient, InMemoryCache, createHttpLink, gql } from "@apollo/client";

export default function Home({repository}) {
  return ( <div> {repository.latestRelease.tagName} </div> )
}

export async function getStaticProps() {
  const httpLink = createHttpLink({ uri: 'https://api.github.com/graphql' });
  const authLink = setContext((_, { headers }) => {
    return { headers: { ...headers, authorization: `Bearer <TOKEN>` } }
  });
  const client = new ApolloClient({
    link: authLink.concat(httpLink),
    cache: new InMemoryCache()
  });
  const {data} = await client.query({
    query: gql`
      { 
        repository(owner: "paritytech", name: "polkadot", followRenames: true) {
          latestRelease { tagName }
        }
      }
    `
  });
  const { repository } = data;

  return {
    props: { repository }
  }
}

For Support && Nominations