import { FactoryContextDefinition } from '~/types/factory/factory.context' ; import { FaunaRef } from '~/types/fauna' ; import { query as q , Expr } from 'faunadb' ; interface ActionDispatchResult { action ? : object ; doc ? : object ; } interface ResultInferface { context ? : FactoryContextDefinition ; data ? : any ; action ? : object ; } export function Result ( result = null , actionResult = { } , context = q . Var ( 'ctx' ) ) { return { context , data : result , action : actionResult , } ; } export function ResultData ( result ) { return q . Select ( 'data' , result , null ) ; } export function ResultAction ( result ) { return q . Select ( 'action' , result , null ) ; }