From b49451d6e60e144748af62616b281ac79512ed7a Mon Sep 17 00:00:00 2001 From: Adrian Pilarczyk Date: Thu, 11 May 2023 14:49:06 +0200 Subject: [PATCH] feat: :alembic: add logging to channels-fetcher --- apps/taxes/src/modules/channels/channels-fetcher.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/apps/taxes/src/modules/channels/channels-fetcher.ts b/apps/taxes/src/modules/channels/channels-fetcher.ts index 21019e6..e010c97 100644 --- a/apps/taxes/src/modules/channels/channels-fetcher.ts +++ b/apps/taxes/src/modules/channels/channels-fetcher.ts @@ -3,22 +3,31 @@ import { TaxConfigurationsListDocument, TaxConfigurationsListQueryVariables, } from "../../../generated/graphql"; +import { createLogger } from "../../lib/logger"; export class ChannelsFetcher { constructor(private client: Client) {} fetchChannels() { - return this.client + const logger = createLogger({ service: "ChannelsFetcher" }); + + logger.fatal("fetchChannels called"); + + const response = this.client .query(TaxConfigurationsListDocument, { first: 10, } as TaxConfigurationsListQueryVariables) .toPromise() .then((r) => { + logger.fatal({ response: r.data }, "raw fetchChannels response"); return ( r.data?.taxConfigurations?.edges .filter(({ node }) => node.taxCalculationStrategy === "TAX_APP") .map(({ node }) => node.channel) ?? [] ); }); + + logger.fatal({ response }, "filtered fetchChannels response"); + return response; } }