Skip to content

Commit

Permalink
fix stitching logging
Browse files Browse the repository at this point in the history
  • Loading branch information
damassi committed Sep 28, 2021
1 parent bbe5d60 commit 4a6fbee
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
2 changes: 2 additions & 0 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ const {
IMPULSE_APPLICATION_ID,
INTROSPECT_TOKEN,
IP_BLACKLIST,
LOG_HTTP_LINKS,
LOG_QUERY_DETAILS_THRESHOLD,
MEMCACHED_MAX_POOL,
MEMCACHED_URL,
Expand Down Expand Up @@ -193,6 +194,7 @@ export default {
IMPULSE_APPLICATION_ID,
INTROSPECT_TOKEN,
IP_BLACKLIST: IP_BLACKLIST || "",
LOG_HTTP_LINKS,
LOG_QUERY_DETAILS_THRESHOLD,
MEMCACHED_MAX_POOL: Number(MEMCACHED_MAX_POOL) || 10,
MEMCACHED_URL: MEMCACHED_URL || "localhost:11211",
Expand Down
13 changes: 7 additions & 6 deletions src/lib/stitching2/kaws/v2/stitching.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export const kawsStitchingEnvironmentV2 = (
marketingCollections: {
selectionSet: `{ internalID }`,
resolve: ({ internalID: artistID }, args, context, info) => {
console.log("************************* resolving here!")
return delegateToSchema({
schema: kawsSchema,
operation: "query",
Expand Down Expand Up @@ -152,12 +153,12 @@ export const kawsStitchingEnvironmentV2 = (
MarketingCollection: {
artworksConnection: {
fragment: `
fragment MarketingCollectionQuery on MarketingCollection {
query {
${Object.keys(filterArtworksArgs).join("\n")}
}
}
`,
fragment MarketingCollectionQuery on MarketingCollection {
query {
${Object.keys(filterArtworksArgs).join("\n")}
}
}
`,
resolve: (parent, _args, context, info) => {
const query = parent.query
const hasKeyword = Boolean(parent.query.keyword)
Expand Down
6 changes: 4 additions & 2 deletions src/lib/stitching2/middleware/responseLoggerMiddleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ import { ExecutorMiddleware } from "lib/stitching2/lib/createRemoteExecutor"
import extensionsLogger from "lib/loaders/api/extensionsLogger"
import config from "config"

const { ENABLE_REQUEST_LOGGING, LOG_HTTP_LINKS } = config

const shouldLogLinkTraffic =
!!process.env.LOG_HTTP_LINKS && typeof jest === "undefined"
const { ENABLE_REQUEST_LOGGING } = config
LOG_HTTP_LINKS === "true" && typeof jest === "undefined"

const enableRequestLogging = ENABLE_REQUEST_LOGGING === "true"

export const responseLoggerMiddleware = (name: string): ExecutorMiddleware => {
Expand Down

0 comments on commit 4a6fbee

Please sign in to comment.