@@ -12,7 +12,9 @@ import graphql.language.FieldDefinition
1212import graphql.language.TypeName
1313import graphql.schema.DataFetchingEnvironment
1414import org.apache.commons.lang3.ClassUtils
15+ import org.apache.commons.lang3.StringUtils
1516import org.apache.commons.lang3.reflect.FieldUtils
17+ import org.apache.commons.lang3.text.WordUtils
1618import org.slf4j.LoggerFactory
1719import java.lang.reflect.Method
1820import java.lang.reflect.Modifier
@@ -83,6 +85,7 @@ internal class FieldResolverScanner(val options: SchemaParserOptions) {
8385 // 2. Method that returns a boolean with "is" style getter
8486 // 3. Method with "get" style getter
8587 // 4. Method with "getField" style getter
88+ // 5. Method with "get" style getter with the field name converted from snake_case to camelCased. ex: key_ops -> getKeyOps()
8689 return methods.find {
8790 it.name == name && verifyMethodArguments(it, argumentCount, search)
8891 } ? : methods.find {
@@ -91,6 +94,8 @@ internal class FieldResolverScanner(val options: SchemaParserOptions) {
9194 it.name == " get${name.capitalize()} " && verifyMethodArguments(it, argumentCount, search)
9295 } ? : methods.find {
9396 it.name == " getField${name.capitalize()} " && verifyMethodArguments(it, argumentCount, search)
97+ } ? : methods.find {
98+ it.name == " get${StringUtils .remove(WordUtils .capitalizeFully(name, ' _' ), " _" )} " && verifyMethodArguments(it, argumentCount, search)
9499 }
95100 }
96101
0 commit comments