push type-name into types.go

This commit is contained in:
Ben Kraft
2020-04-10 14:30:56 -07:00
parent 4f02619b0b
commit dfea9bf128
5 changed files with 16 additions and 14 deletions
+4 -3
View File
@@ -111,7 +111,9 @@ func fromASTOperation(op *ast.OperationDefinition, schema *ast.Schema) (operatio
}
}
typ, err := typeForOperation(op, schema)
// TODO: configure ResponseName format
responseName := op.Name + "Response"
typ, err := typeForOperation(responseName, op, schema)
if err != nil {
return operation{}, fmt.Errorf("could not compute return-type for query: %v", err)
}
@@ -124,8 +126,7 @@ func fromASTOperation(op *ast.OperationDefinition, schema *ast.Schema) (operatio
Body: "\n" + builder.String(),
Args: args,
// TODO: configure ResponseName format
ResponseName: op.Name + "Response",
ResponseName: responseName,
ResponseType: typ,
}, nil
}