fjtirado commented on code in PR #2196:
URL: 
https://github.com/apache/incubator-kie-kogito-apps/pull/2196#discussion_r1970479176


##########
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:
   Same, I did not change the original code, just moved it (so it appears in 
the review)  Env is never going to be null, so there is not need   to check it 
(I cannot think of an scenario where cache is null, but since the code was 
already there and was unrelated with the PR, I prefer to not change that, just 
in case)



-- 
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]

Reply via email to