Skip to content

Commit

Permalink
fix: "update" keyword treat as mutation
Browse files Browse the repository at this point in the history
  • Loading branch information
dalechyn committed Jan 29, 2025
1 parent b4fc7ab commit 3b0d86a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/cli/commands/Generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,9 @@ export async function generate(options: Generate = {}) {

await Promise.all(
functionNames.map(async (functionName) => {
const hookType = functionName === 'create' ? 'Mutation' : 'Query'
const hookType = ['create', 'update'].includes(functionName)
? 'Mutation'
: 'Query'
const outputHook = `use${namespaceName}${functionName.slice(0, 1).toUpperCase()}${functionName.slice(1)}${hookType}`
await fs.ensureDir(resolve(config.out, outputHook))

Expand Down

0 comments on commit 3b0d86a

Please sign in to comment.