fjtirado commented on code in PR #2196:
URL:
https://github.com/apache/incubator-kie-kogito-apps/pull/2196#discussion_r1971387358
##########
data-index/data-index-graphql/src/main/java/org/kie/kogito/index/graphql/AbstractGraphQLSchemaManager.java:
##########
@@ -205,10 +228,22 @@ protected <K, T> List<T>
executeAdvancedQueryForCache(StorageFetcher<K, T> cache
query.offset(offset);
}
}
-
return query.execute();
}
+ protected <K, T> long executeCount(StorageFetcher<K, T> cache,
DataFetchingEnvironment env) {
+ return setupQuery(cache, env).count();
+ }
+
+ private <K, T> Query<T> setupQuery(StorageFetcher<K, T> cache,
DataFetchingEnvironment env) {
+ Objects.requireNonNull(cache, "Cache not found");
Review Comment:
After taking another view, I decided to change the original code to not
check for nulls that are not going to be null outside test contest and check
for nulls that might actually be there (although they apparently not in current
scenarios)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]