Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
connectionCallback: async (error) => {
if (error) {
logger.trace('[connectionCallback error] %j', error);
// error.message has to match what the server returns.
if ((error as any).message === 'TokenExpired') {
console.log('onTokenError about to call');
// Reset the WS connection for it to carry the new JWT.
(wsLink as any).subscriptionClient.close(false, false);
}
}
},
},
props: ({ countData }: any) => {
const newlog = logger.child({ childName: 'UIController' });
newlog.debug('count data : (%j)', countData);
return {
subscribeToCount: params => {
// logger.debug('count subscript data (%j)', params);
return countData.subscribeToMore({
document: COUNT_SUBSCRIPTION,
variables: {},
updateQuery: (prev: any, { subscriptionData }) => {
const payload = subscriptionData.data && subscriptionData.data.subscribeToWorkspace;
if (!payload) {
return prev;
}
return payload;
},
});
},
import { ClientLogger } from '@cdm-logger/client';
const logLevel = process.env.LOG_LEVEL || 'trace';
const logger = ClientLogger.create('FullStack', { level: logLevel });
export { logger };