redo type naming

This commit is contained in:
Ben Kraft
2021-03-19 18:40:58 -07:00
parent 58f4aff83b
commit fed38e4f55
20 changed files with 210 additions and 164 deletions
+3 -2
View File
@@ -33,8 +33,9 @@ func (builder *typeBuilder) maybeWriteUnmarshal(fields []field) error {
for _, typedef := range builder.schema.GetPossibleTypes(typedef) {
fieldInfo.ConcreteTypes = append(fieldInfo.ConcreteTypes,
concreteType{
// TODO: lies! We might have added "1" or something.
GoName: upperFirst(typedef.Name),
// TODO: this is quite fragile (and maybe wrong if the
// field name + type name are the same)
GoName: builder.typeNamePrefix + fieldInfo.GoName + upperFirst(typedef.Name),
GraphQLName: typedef.Name,
})
}