File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
graphql-kotlin-toolkit-codegen/src/main/kotlin/com/auritylab/graphql/kotlin/toolkit/codegen/mapper Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ package com.auritylab.graphql.kotlin.toolkit.codegen.mapper
2
2
3
3
import com.auritylab.graphql.kotlin.toolkit.codegen.CodegenOptions
4
4
import com.auritylab.graphql.kotlin.toolkit.codegen.helper.NamingHelper
5
+ import com.auritylab.graphql.kotlin.toolkit.codegen.helper.lowercaseFirst
5
6
import com.squareup.kotlinpoet.ClassName
6
7
import com.squareup.kotlinpoet.MemberName
7
8
import graphql.schema.GraphQLEnumType
@@ -57,8 +58,16 @@ internal class GeneratedMapper(
57
58
/* *
58
59
* Will return the [MemberName] of the builder method for the given [inputObject].
59
60
*/
60
- fun getInputObjectBuilderMemberName (inputObject : GraphQLInputObjectType ): MemberName =
61
- MemberName (getGeneratedTypeClassName(inputObject).addSimpleNames(" Companion" ), " buildByMap" )
61
+ fun getInputObjectBuilderMemberName (inputObject : GraphQLInputObjectType ): MemberName {
62
+ val uppercaseInputObject = inputObject.name.lowercaseFirst()
63
+ val joinedMethodNamed = uppercaseInputObject + " BuildByMap"
64
+
65
+ // Build the MemberName for with the joined method name as actual method name.
66
+ return MemberName (
67
+ getGeneratedTypeClassName(inputObject).addSimpleNames(" Companion" ),
68
+ joinedMethodNamed
69
+ )
70
+ }
62
71
63
72
/* *
64
73
* Will return the [MemberName] which points to a string which contains the name of the container for the given field resolver.
You can’t perform that action at this time.
0 commit comments