import { FetchFunction } from "relay-runtime" ; /**
 * Decorates the fetch function with error logging.
 * Intended for testing purposes.
 */ export default function wrapFetchWithLogger ( fetch , options = { } ) { return async ( ... args ) => { try { const result = await ( fetch as any ) ( ... args ) ; if ( options . logResult ) { console . log ( JSON . stringify ( result ) ) ; } return result ; } catch ( err ) { if ( ! options . muteErrors ) { console . error ( err ) ; } throw err ; } } ; }