UNPKG

@smartinvoicexyz/graphql

Version:

Unified source for helpers and schema used across the GraphQL services within the Smart Invoice protocol.

22 lines (21 loc) 504 B
import { ZeusScalars } from './zeus'; export const scalars = ZeusScalars({ BigDecimal: { encode: (e) => e.toString(10), decode: (e) => BigInt(e), }, BigInt: { encode: (e) => e.toString(10), decode: (e) => BigInt(e), }, Bytes: { decode: (e) => { const str = e; return str.startsWith('0x') ? str : `0x${str}`; }, }, Int8: { encode: (e) => e.toString(), decode: (e) => Number(e), }, });