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
+2 -1
View File
@@ -25,8 +25,9 @@ func (builder *typeBuilder) baseTypeForOperation(operation ast.Operation) *ast.D
}
}
func typeForOperation(operation *ast.OperationDefinition, schema *ast.Schema) (string, error) {
func typeForOperation(name string, operation *ast.OperationDefinition, schema *ast.Schema) (string, error) {
builder := &typeBuilder{schema: schema}
fmt.Fprintf(builder, "type %s ", name)
err := builder.writeTypedef(
builder.baseTypeForOperation(operation.Operation), operation.SelectionSet)
return builder.String(), err