Skip to content

Commit

Permalink
Fix scalar list selection (2)
Browse files Browse the repository at this point in the history
  • Loading branch information
joostfarla committed Mar 14, 2024
1 parent c010d02 commit 7cdcbdf
Showing 1 changed file with 2 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import graphql.schema.DataFetchingFieldSelectionSet;
import graphql.schema.GraphQLList;
import graphql.schema.GraphQLObjectType;
import graphql.schema.GraphQLScalarType;
import graphql.schema.SelectedField;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -122,7 +121,7 @@ private <B extends AbstractDataRequest.Builder<B>> B selectProperties(B requestB
return;
}

if (fieldType instanceof GraphQLList && !isScalar(unwrapAll(fieldType)) ) {
if (fieldType instanceof GraphQLList && !isScalar(unwrapAll(fieldType))) {
requestBuilder.selectCollectionProperty(fieldName, nestedRequestBuilder -> {
selectProperties(nestedRequestBuilder, selectedField.getSelectionSet());
return nestedRequestBuilder.build();
Expand All @@ -131,12 +130,7 @@ private <B extends AbstractDataRequest.Builder<B>> B selectProperties(B requestB
return;
}

if (fieldType instanceof GraphQLScalarType) {
requestBuilder.selectProperty(fieldName);
return;
}

throw new UnsupportedOperationException();
requestBuilder.selectProperty(fieldName);
});

return requestBuilder;
Expand Down

0 comments on commit 7cdcbdf

Please sign in to comment.