import { Environment } from "relay-runtime" ; import { createFetch } from "coral-framework/lib/relay" ; export default function createDashboardFetch < T > ( name , url ) { return createFetch ( name , async ( environment , variables , { rest } ) => { const params = new URLSearchParams ( variables ) ; const { timeZone } = Intl . DateTimeFormat ( ) . resolvedOptions ( ) ; params . set ( "tz" , timeZone ) ; return rest . fetch < T > ( `${ url }?${ params . toString ( ) }` , { method : "GET" , } ) ; } ) ; }