You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by bd...@apache.org on 2021/06/24 13:16:45 UTC
[sling-org-apache-sling-graphql-core] branch master updated
(9a99ba5 -> de82d3b)
This is an automated email from the ASF dual-hosted git repository.
bdelacretaz pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-graphql-core.git.
from 9a99ba5 SLING-10502 - lazy loading helpers (#25)
add 88e77fe SLING-10502 - lazy loading helpers
add 0d5ba05 SLING-10502 - prevent Sonar complaints
add 9761ecd SLING-10502 - use put for suppliers + add a few tests
add 7aea4ef SLING-10502 - lazy loading helpers
add fd8cec9 SLING-10502 - prevent Sonar complaints
add b2efbec SLING-10502 - use put for suppliers + add a few tests
add 589bd38 Merge branch 'SLING-10502/lazy-loading' of github.com:apache/sling-org-apache-sling-graphql-core into SLING-10502/lazy-loading
add 34f1f32 SLING-10502 - verify how the engine uses lazy fields
add 2654a06 SLING-10502 - Remove synchronization, add Stats, remove returns null, improve LazyLoadingField
add f476529 SLING-10502 - keep Sonar happy
add 2eb8340 SLING-10502 - remove unused method
add fa327f2 Merge commit 'd430d47df5b190107d413f31ef19052aacab4d98' into SLING-10502/lazy-loading
add 6268351 SLING-10502 - add logging test
add 26d5bed SLING-10502 - log at the DEBUG level
add 943c624 SLING-10502 - add computeValueOnRemove and computeAllThrowsException options
add c4800a5 SLING-10502 - fix package name typo (that no one caught so far ;-)
add 222edb2 SLING-10502 - document the lazy loading helpers
new 9ce2061 Merge branch 'SLING-10502/lazy-loading'
new 06323f6 Merge branch 'master' of github.com:apache/sling-org-apache-sling-graphql-core
new de82d3b SLING-10541 - fix error with empty result set
The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../java/org/apache/sling/graphql/helpers/GenericConnection.java | 3 ++-
.../sling/graphql/core/pagination/GenericConnectionTest.java | 8 ++++++++
2 files changed, 10 insertions(+), 1 deletion(-)
[sling-org-apache-sling-graphql-core] 02/03: Merge branch 'master'
of github.com:apache/sling-org-apache-sling-graphql-core
Posted by bd...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
bdelacretaz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-graphql-core.git
commit 06323f61bf0a0cdf2667afba9fbbf444cc788830
Merge: 9ce2061 9a99ba5
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Thu Jun 24 13:54:18 2021 +0200
Merge branch 'master' of github.com:apache/sling-org-apache-sling-graphql-core
[sling-org-apache-sling-graphql-core] 03/03: SLING-10541 - fix
error with empty result set
Posted by bd...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
bdelacretaz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-graphql-core.git
commit de82d3b80f921515b3e901ee8dba38986de28161
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Thu Jun 24 15:15:14 2021 +0200
SLING-10541 - fix error with empty result set
---
.../java/org/apache/sling/graphql/helpers/GenericConnection.java | 3 ++-
.../sling/graphql/core/pagination/GenericConnectionTest.java | 8 ++++++++
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/src/main/java/org/apache/sling/graphql/helpers/GenericConnection.java b/src/main/java/org/apache/sling/graphql/helpers/GenericConnection.java
index aaefe55..7b3d1be 100644
--- a/src/main/java/org/apache/sling/graphql/helpers/GenericConnection.java
+++ b/src/main/java/org/apache/sling/graphql/helpers/GenericConnection.java
@@ -74,6 +74,7 @@ public final class GenericConnection<T> implements Connection<T>, PageInfo {
throw new IllegalStateException("Already initialized");
}
initialized = true;
+ final boolean anyData = dataIterator.hasNext();
// Need to visit the stream first to setup the PageInfo, which graphql-java
// apparently uses before visiting all the edges
@@ -111,7 +112,7 @@ public final class GenericConnection<T> implements Connection<T>, PageInfo {
}
}
- if(!inRange && limit > 0) {
+ if(anyData && !inRange && limit > 0) {
throw new SlingGraphQLException("Start cursor not found in supplied data:" + startAfter);
}
if(hasPreviousPage == null) {
diff --git a/src/test/java/org/apache/sling/graphql/core/pagination/GenericConnectionTest.java b/src/test/java/org/apache/sling/graphql/core/pagination/GenericConnectionTest.java
index d71d09a..a531ebf 100644
--- a/src/test/java/org/apache/sling/graphql/core/pagination/GenericConnectionTest.java
+++ b/src/test/java/org/apache/sling/graphql/core/pagination/GenericConnectionTest.java
@@ -19,10 +19,12 @@
package org.apache.sling.graphql.core.pagination;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import java.util.Arrays;
+import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;
@@ -185,4 +187,10 @@ public class GenericConnectionTest {
assertTrue(iex.getMessage().contains("aximum"));
}
}
+
+ @Test
+ public void testEmptyResultSet() {
+ final Connection<String> empty = new GenericConnection.Builder<String>(Collections.emptyIterator(), s -> s).build();
+ assertFalse("Expecting no data", empty.getEdges().iterator().hasNext());
+ }
}
[sling-org-apache-sling-graphql-core] 01/03: Merge branch
'SLING-10502/lazy-loading'
Posted by bd...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
bdelacretaz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-graphql-core.git
commit 9ce2061d4f4727082e7e64e607411302611cad0d
Merge: 078bfb4 222edb2
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Thu Jun 24 12:58:19 2021 +0200
Merge branch 'SLING-10502/lazy-loading'
README.md | 32 +-
.../helpers/lazyloading/LazyLoadingField.java | 48 +++
.../helpers/lazyloading/LazyLoadingMap.java | 197 ++++++++++
.../graphql/helpers/lazyloading/package-info.java | 26 ++
.../core/engine/DefaultQueryExecutorTest.java | 36 ++
.../sling/graphql/core/mocks/LazyDataFetcher.java | 70 ++++
.../apache/sling/graphql/core/util/LogCapture.java | 12 +-
.../helpers/lazyloading/LazyLoadingFieldTest.java | 64 ++++
.../helpers/lazyloading/LazyLoadingMapTest.java | 409 +++++++++++++++++++++
src/test/resources/test-schema.txt | 8 +
10 files changed, 899 insertions(+), 3 deletions(-)