XYOracleNetwork/client-xyo-nodejs

View on GitHub
src/context/connectionResolvers/graphql/xyo-graphql-summary-historical.ts

Summary

Maintainability
A
2 hrs
Test Coverage
/* eslint-disable @typescript-eslint/no-unused-vars */
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable @typescript-eslint/explicit-function-return-type */
import { request } from 'graphql-request'
import { IXyoConnectionConfig } from '../../xyo-context-config'

export const collectorStatsSummaryHistorical = async (
  config: IXyoConnectionConfig,
  command: string
) => {
  const query = `
        query SummaryHistorical {
            collectorStatsSummaryHistorical
        }
      `

  const result = (await request(config.uri, query)) as any

  return [
    {
      result: result.collectorStatsSummaryHistorical,
      id: JSON.stringify(result.collectorStatsSummaryHistorical),
    },
  ]
}