Skip to content

Commit

Permalink
fix default value handling
Browse files Browse the repository at this point in the history
  • Loading branch information
radiden committed Aug 29, 2024
1 parent f854a19 commit 5ac2b4f
Show file tree
Hide file tree
Showing 2 changed files with 7,115 additions and 5,611 deletions.
11 changes: 3 additions & 8 deletions packages/houdini/src/codegen/transforms/fragmentVariables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -368,14 +368,9 @@ export function fragmentArguments(
}

let type = parseArgumentTypeString(typeArg.value)
let defaultValueField =
arg.value.fields?.find((arg) => arg.name.value === 'default')?.value || null
let defaultValue
if (defaultValueField?.kind === graphql.Kind.STRING) {
defaultValue = defaultValueField as graphql.ConstValueNode
} else {
defaultValue = null
}
let defaultValue =
(arg.value.fields?.find((arg) => arg.name.value === 'default')
?.value as graphql.ConstValueNode) || null

return [
{
Expand Down
Loading

0 comments on commit 5ac2b4f

Please sign in to comment.