import User from "../../../entities/User" ; import { ToggleDrivingModeResponse } from "../../../types/graph" ; import { Resolvers } from "../../../types/resolvers" ; import privateResolver from "../../../utils/privateResolver" ; const resolvers = { Mutation : { ToggleDrivingMode : privateResolver ( async ( _ , __ , { req } ) : Promise < ToggleDrivingModeResponse > => { const user = req . user ; user . isDriving = ! user . isDriving ; user . save ( ) ; return { ok : true , error : null } ; } ) } } ; export default resolvers ;