You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: libraries/apollo-compiler/src/main/kotlin/com/apollographql/apollo/compiler/internal/checkCapitalizedFields.kt
+28-18Lines changed: 28 additions & 18 deletions
Original file line number
Diff line number
Diff line change
@@ -20,8 +20,8 @@ internal fun checkCapitalizedFields(definitions: List<GQLDefinition>, checkFragm
@@ -42,26 +42,34 @@ private fun ValidationScope.checkCapitalizedFields(selections: List<GQLSelection
42
42
val alias = it.alias
43
43
if (alias !=null) {
44
44
if (isFirstLetterUpperCase(alias)) {
45
-
issues.add(UpperCaseField(message ="""
45
+
issues.add(
46
+
UpperCaseField(
47
+
message ="""
46
48
Capitalized alias '$alias' is not supported as it causes name clashes with the generated models. Use '${decapitalizeFirstLetter(alias)}' instead.
47
49
""".trimIndent(),
48
-
sourceLocation = it.sourceLocation)
50
+
sourceLocation = it.sourceLocation
51
+
)
49
52
)
50
53
}
51
54
} elseif (isFirstLetterUpperCase(it.name)) {
52
-
issues.add(UpperCaseField(message ="""
53
-
Capitalized field '${it.name}' is not supported as it causes name clashes with the generated models. Use an alias instead or the 'flattenModels' or 'decapitalizeFields' compiler option.
54
-
""".trimIndent(),
55
-
sourceLocation = it.sourceLocation)
55
+
issues.add(
56
+
UpperCaseField(
57
+
message ="""
58
+
Capitalized field '${it.name}' is not supported as it causes name clashes with the generated models. Use an alias instead or the 'flattenModels' or 'decapitalizeFields' compiler option.
0 commit comments