Skip to content
Snippets Groups Projects
queries.js 4.56 KiB
Newer Older
import gql from "graphql-tag"

// Pour la sidebar
export const LAST_BLOCK = gql`query LastBlock{
	countMax {
    number
    bct
    utc0
  }
}`

// Pour la page index
export const LAST_EVENTS = gql`query LastEvents($start: Int64, $end: Int64) {
  membersCount(start: $start, end: $end) {
    idList {
      __typename
      member : id {
        __typename
        pubkey
        uid
        status
        hash
        limitDate
        history {
          __typename
          in
          block {
            __typename
          }
        }
        received_certifications {
          __typename
          limit
      }
      inOut
    },
    block {
      __typename
      number
} `

// Pour la page previsions/index
export const PREVISIONS = gql`query GetDossiers {
      number
      bct
      __typename
    }
    parameter(name: sigQty) {
      sigQty: value
      __typename
    }
    wwFile(full: true) {
      certifs_dossiers {
        ... on MarkedDatedCertification {
          datedCertification {
            date
            certification {
              from {
                uid
                __typename
              }
              to {
                uid
                __typename
              }
              expires_on
              __typename
            }
            __typename
          }
          __typename
        }
        ... on MarkedDossier {
          dossier {
            main_certifs
            newcomer {
              uid
              lastApplication {
                lastAppDate: bct
                __typename
              }
              distance: distanceE {
                value {
                  ratio
                  __typename
                dist_ok
                __typename
              }
              __typename
            date
            minDate
            expires_on: limit
            certifications {
              date
              certification {
                from {
                  uid
                  quality {
                    ratio
                    __typename
                  }
                  __typename
                expires_on
                __typename
              }
              __typename
            __typename
          }
          __typename
      }
      __typename

// Pour la page previsions/newcomers
export const NEWCOMERS = gql`query GetNewcomers{
        __typename
        permutations_nb
        dossiers_nb
        certifs_nb
        forecastsByNames {
            __typename
                __typename
                pubkey
                uid
                status
                hash
                limitDate
                received_certifications {
                    __typename
                    limit
                }
            }
            date
            after
            proba
        }
    }
} `

// Pour la page membres/index
export const SEARCH_MEMBERS = gql`query SearchMember($hint: String) {
    idSearch(with: {hint: $hint}) {
        __typename
            __typename
            pubkey
            uid
            status
            hash
            limitDate
            received_certifications {
                __typename
                limit
            }
        }
    }
} `

// Pour la page membres/_hash
export const SEARCH_MEMBER = gql`query SearchMemberWithHash($hash: Hash!) {
    idFromHash(hash: $hash) {
        pubkey
        isLeaving
        sentry
        membership_pending
        limitDate
Pierre-Jean CHANCELLIER's avatar
Pierre-Jean CHANCELLIER committed
        distanceE {
          __typename
          value {
            __typename
            ratio
          }
          dist_ok
        }
            __typename
        }
        received_certifications {
          __typename
          certifications {
            __typename
        }
        sent_certifications {
          __typename
          to {
            ...attr
          }
          expires_on
fragment attr on Identity {
Pierre-Jean CHANCELLIER's avatar
Pierre-Jean CHANCELLIER committed
  minDate
  minDatePassed
    __typename
    ratio
  }
  received_certifications {
    __typename
    limit
  }
}`

// Pour la page parametres
export const PARAMS = gql`query getParams{
  allParameters {
    name
    par_type
    value
    comment
  }