diff --git a/packages/cli/src/commands/setup/graphql/features/fragments/fragments.ts b/packages/cli/src/commands/setup/graphql/features/fragments/fragments.ts index a473168e6f94..8ff947017457 100644 --- a/packages/cli/src/commands/setup/graphql/features/fragments/fragments.ts +++ b/packages/cli/src/commands/setup/graphql/features/fragments/fragments.ts @@ -1,5 +1,7 @@ import type { Argv } from 'yargs' +import { recordTelemetryAttributes } from '@redwoodjs/cli-helpers' + export const command = 'fragments' export const description = 'Set up Fragments for GraphQL' @@ -17,6 +19,11 @@ export interface Args { } export async function handler({ force }: Args) { + recordTelemetryAttributes({ + command: 'setup graphql fragments', + force, + }) + const { handler } = await import('./fragmentsHandler.js') return handler({ force }) } diff --git a/packages/cli/src/commands/setup/graphql/features/fragments/fragmentsHandler.ts b/packages/cli/src/commands/setup/graphql/features/fragments/fragmentsHandler.ts index dc9b4937e2da..79ed26194b76 100644 --- a/packages/cli/src/commands/setup/graphql/features/fragments/fragmentsHandler.ts +++ b/packages/cli/src/commands/setup/graphql/features/fragments/fragmentsHandler.ts @@ -6,11 +6,7 @@ import execa from 'execa' import { Listr } from 'listr2' import { format } from 'prettier' -import { - colors, - recordTelemetryAttributes, - prettierOptions, -} from '@redwoodjs/cli-helpers' +import { colors, prettierOptions } from '@redwoodjs/cli-helpers' import { getConfigPath, getPaths } from '@redwoodjs/project-config' import type { Args } from './fragments' @@ -20,11 +16,6 @@ export const command = 'fragments' export const description = 'Set up Fragments for GraphQL' export async function handler({ force }: Args) { - recordTelemetryAttributes({ - command: 'setup graphql fragments', - force, - }) - const redwoodTomlPath = getConfigPath() const redwoodTomlContent = fs.readFileSync(redwoodTomlPath, 'utf-8') // Can't type toml.parse because this PR has not been included in a released yet