File tree 1 file changed +7
-3
lines changed
aws-api-appsync/src/main/java/com/amplifyframework/api/aws
1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -156,19 +156,23 @@ public String getQuery() {
156
156
}
157
157
158
158
String modelName = Casing .capitalizeFirst (modelSchema .getName ());
159
+ String pluralName = modelSchema .getPluralName () != null &&
160
+ !modelSchema .getPluralName ().isEmpty ()
161
+ ? Casing .capitalizeFirst (modelSchema .getPluralName ())
162
+ : modelName + "s" ;
159
163
if (QueryType .LIST .equals (operation )) {
160
164
modelName = modelSchema .getListPluralName () != null
161
165
&& !modelSchema .getListPluralName ().isEmpty ()
162
166
? Casing .capitalizeFirst (modelSchema .getListPluralName ())
163
- : Casing . capitalizeFirst ( modelSchema . getPluralName ()) ;
167
+ : pluralName ;
164
168
} else if (QueryType .SYNC .equals (operation )) {
165
169
// The sync operation name is pluralized using pluralize.js, which uses more complex pluralization rules
166
170
// than simply adding an 's' at the end (e.g. baby > babies, person > people, etc). This pluralized name
167
171
// is an annotation on the codegen'd model class, so we will just grab it from the ModelSchema.
168
172
modelName = modelSchema .getSyncPluralName () != null
169
- && !modelSchema .getSyncPluralName ().isEmpty ()
173
+ && !modelSchema .getSyncPluralName ().isEmpty ()
170
174
? Casing .capitalizeFirst (modelSchema .getSyncPluralName ())
171
- : Casing . capitalizeFirst ( modelSchema . getPluralName ()) ;
175
+ : pluralName ;
172
176
}
173
177
174
178
String operationString =
You can’t perform that action at this time.
0 commit comments