Skip to content

Commit

Permalink
Add loggin in device resource
Browse files Browse the repository at this point in the history
  • Loading branch information
Gutierrez, Andres committed May 1, 2021
1 parent bb1606a commit 90eec96
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/resolvers/device/mutations.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ const updateDevice = async (_, args, { loaders }) => {
logger.info("Executing MUTATION| UpdateDevice");
const { deviceId, name, port, agentDb } = args;
await dal.updateDevice(deviceId, name, port, agentDb);
const deviceObj = await dal.searchOneDevice(deviceId);
await loaders.devices.prime(deviceId, deviceObj[0]);
await loaders.devices.clear(args.deviceId);
await loaders.devices.load(args.deviceId);
return true;
};

Expand All @@ -33,7 +33,9 @@ const removeDevice = async (_, args, { loaders }) => {

const startSimulation = async (_, { deviceId }) => {
logger.info("Executing MUTATION| startSimulation");
return await grpcStartSimulation(deviceId);
const response = await grpcStartSimulation(deviceId);
logger.info(`Resolved response [${response}]`);
return response;
};

const stopSimulation = async (_, { deviceId }) => {
Expand All @@ -43,7 +45,9 @@ const stopSimulation = async (_, { deviceId }) => {

const fixAgentDb = async (_, { agentDb }) => {
logger.info("Executing MUTATION| fixAgent");
return await grpcFixDbAgent(agentDb);
const response = await grpcFixDbAgent(agentDb);
logger.info(`Resolved response [${response}]`);
return response;
};

export default {
Expand Down

0 comments on commit 90eec96

Please sign in to comment.