Skip to content

Commit 5fd8676

Browse files
committed
For now, make all struct args optional
1 parent 610a74e commit 5fd8676

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

internal/parser/interface.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,17 @@ func (p *Parser) getMethodArguments(params *types.Tuple, isInput bool) ([]*schem
111111
return nil, fmt.Errorf("failed to parse argument %v %v: %w", name, typ, err)
112112
}
113113

114+
optional := false
115+
if varType.Struct != nil && varType.Struct.Type != nil {
116+
optional = true // TODO: SHould we use varType.Struct.Type.Optional instead?
117+
}
118+
114119
arg := &schema.MethodArgument{
115120
Name: name,
116121
Type: varType,
117122
InputArg: isInput, // denormalize/back-reference
118123
OutputArg: !isInput, // denormalize/back-reference
124+
Optional: optional,
119125
}
120126

121127
args = append(args, arg)

0 commit comments

Comments
 (0)