File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed
main/java/graphql/execution
test/groovy/graphql/execution Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -149,8 +149,10 @@ public static ResultPath fromList(List<?> objects) {
149
149
for (Object object : objects ) {
150
150
if (object instanceof String ) {
151
151
path = path .segment (((String ) object ));
152
- } else {
152
+ } else if ( object instanceof Integer ) {
153
153
path = path .segment ((int ) object );
154
+ } else if (object != null ) {
155
+ path = path .segment (object .toString ());
154
156
}
155
157
}
156
158
return path ;
Original file line number Diff line number Diff line change @@ -212,6 +212,13 @@ class ResultPathTest extends Specification {
212
212
path. toList() == [" a" , " b" ]
213
213
}
214
214
215
+ def " pass any other object than string or int" (){
216
+ when :
217
+ ResultPath . fromList([" a" , " b" , true ])
218
+
219
+ then :
220
+ notThrown(ClassCastException )
221
+ }
215
222
216
223
def " can append paths" () {
217
224
when :
You can’t perform that action at this time.
0 commit comments