UNPKG

@smartinvoicexyz/graphql

Version:

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

12 lines (11 loc) 819 B
import { InMemoryCache, QueryOptions } from '@apollo/client'; import { SupportedChainId } from '@smartinvoicexyz/constants'; import { scalars } from './scalars'; import { GenericOperation, GraphQLTypes, InputType, OperationOptions, ValueTypes } from './zeus'; import { Ops } from './zeus/const'; export declare const getCache: (chainId: SupportedChainId) => InMemoryCache; type Scalars = typeof scalars; export declare const fetchTypedQuery: <O extends keyof typeof Ops, R extends keyof ValueTypes = GenericOperation<O>>(chainId: number) => <Z extends ValueTypes[R]>(o: Z & { [P in keyof Z]: P extends keyof ValueTypes[R] ? Z[P] : never; }, ops?: OperationOptions & { variables?: Record<string, unknown>; } & Omit<QueryOptions, "query" | "variables">) => Promise<InputType<GraphQLTypes[R], Z, Scalars>>; export {};