Skip to content

Commit

Permalink
graphql setup fragments: Move telemetry to main handler (#9819)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobbe authored Jan 12, 2024
1 parent 9cddaa7 commit 8a51c67
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -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'

Expand All @@ -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 })
}
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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
Expand Down

0 comments on commit 8a51c67

Please sign in to comment.