XYOracleNetwork/client-xyo-nodejs

View on GitHub
src/context/connectionResolvers/graphql/xyo-graphql-pay-to.ts

Summary

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

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

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

  return [
    {
      result: result.payTo,
      id: config.uri,
    },
  ]
}