lowercase for arguments

This commit is contained in:
Ben Kraft
2020-03-27 18:01:56 -07:00
parent 9e01efdd88
commit af5d1bd542
3 changed files with 10 additions and 8 deletions
+5 -3
View File
@@ -52,11 +52,13 @@ type argument struct {
}
func fromASTArg(arg *ast.VariableDefinition, schema *ast.Schema) argument {
graphQLName := arg.Variable
firstRest := strings.SplitN(graphQLName, "", 2)
goName := strings.ToLower(firstRest[0]) + firstRest[1]
return argument{
GraphQLName: arg.Variable,
GoName: arg.Variable, // TODO: normalize this to go-style
GraphQLName: graphQLName,
GoName: goName,
GoType: typeForInputType(arg.Type, schema),
// TODO: figure out what to do about defaults
}
}