Skip to content

Commit

Permalink
feat(condo): INFRA-717 added a request tracing
Browse files Browse the repository at this point in the history
  • Loading branch information
Alllex202 committed Nov 25, 2024
1 parent 7463c98 commit 2e5176b
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions apps/condo/domains/common/utils/next/apollo.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import getConfig from 'next/config'

import { ListHelper } from '@open-condo/apollo'
import type { InitCacheConfig } from '@open-condo/apollo'
import type { InitCacheConfig, ApolloHelperOptions } from '@open-condo/apollo'
import { getTracingMiddleware } from '@open-condo/miniapp-utils'

import { BILLING_RECEIPT_SERVICE_FIELD_NAME } from '@condo/domains/billing/constants/constants'


const { publicRuntimeConfig: { apolloGraphQLUrl } } = getConfig()
const { publicRuntimeConfig: { apolloGraphQLUrl, serverUrl, currentVersion } } = getConfig()

const cacheConfig: InitCacheConfig = (cacheOptions) => {
const listHelper = new ListHelper({ cacheOptions })
Expand Down Expand Up @@ -87,7 +88,14 @@ const cacheConfig: InitCacheConfig = (cacheOptions) => {
}
}

export const apolloHelperOptions = {
export const apolloHelperOptions: ApolloHelperOptions = {
uri: apolloGraphQLUrl,
cacheConfig,
middlewares: [
getTracingMiddleware({
serviceUrl: serverUrl,
codeVersion: currentVersion,
target: 'condo-app',
}),
],
}

0 comments on commit 2e5176b

Please sign in to comment.