UNPKG

@leosprograms/vf-graphql-holochain

Version:

GraphQL schema bindings for the Holochain implementation of ValueFlows

32 lines (25 loc) 825 B
/** * Economic resource mutations * * @package: HoloREA * @since: 2019-10-31 */ import { DNAIdMappings } from '../types.js' import { mapZomeFn } from '../connection.js' import { EconomicResourceUpdateParams, EconomicResourceResponse, } from '@leosprograms/vf-graphql' export interface UpdateArgs { resource: EconomicResourceUpdateParams, } export type updateHandler = (root: any, args: UpdateArgs) => Promise<EconomicResourceResponse> export default (dnaConfig: DNAIdMappings, conductorUri: string) => { const runUpdate = mapZomeFn<UpdateArgs, EconomicResourceResponse>(dnaConfig, conductorUri, 'combined', 'economic_resource', 'update_economic_resource') const updateEconomicResource: updateHandler = async (root, args) => { return runUpdate(args) } return { updateEconomicResource, } }