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/05/17 16:02:05 UTC

[sling-org-apache-sling-graphql-core] 02/02: SLING-10309 - tweaks and cleanup

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 dee6f62a86964855fc2c3072d553be1f7e393287
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Mon May 17 17:59:51 2021 +0200

    SLING-10309 - tweaks and cleanup
---
 src/main/java/org/apache/sling/graphql/api/pagination/Cursor.java     | 1 +
 src/test/java/org/apache/sling/graphql/api/pagination/CursorTest.java | 1 -
 src/test/resources/failing-fetcher-schema.txt                         | 2 ++
 .../resources/initial-content/apps/graphql/test/two/GQLschema.jsp     | 4 +++-
 .../initial-content/apps/graphql/test/two/testing.GQLschema.jsp       | 4 +++-
 5 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/src/main/java/org/apache/sling/graphql/api/pagination/Cursor.java b/src/main/java/org/apache/sling/graphql/api/pagination/Cursor.java
index 7fe0308..a0f07b4 100644
--- a/src/main/java/org/apache/sling/graphql/api/pagination/Cursor.java
+++ b/src/main/java/org/apache/sling/graphql/api/pagination/Cursor.java
@@ -74,6 +74,7 @@ public class Cursor {
      * @param encoded the encoded value from which to generate a new cursor
      * @return a new cursor, if one can be generated; {@code null} otherwise
      */
+    @Nullable
     public static Cursor fromEncodedString(@Nullable String encoded) {
         if(encoded == null) {
             return null;
diff --git a/src/test/java/org/apache/sling/graphql/api/pagination/CursorTest.java b/src/test/java/org/apache/sling/graphql/api/pagination/CursorTest.java
index 68e16be..4aeb425 100644
--- a/src/test/java/org/apache/sling/graphql/api/pagination/CursorTest.java
+++ b/src/test/java/org/apache/sling/graphql/api/pagination/CursorTest.java
@@ -26,7 +26,6 @@ import static org.junit.Assert.assertNull;
 import java.util.UUID;
 
 import org.apache.sling.graphql.api.SlingGraphQLException;
-import org.apache.sling.graphql.api.pagination.Cursor;
 import org.junit.Test;
 
 public class CursorTest {
diff --git a/src/test/resources/failing-fetcher-schema.txt b/src/test/resources/failing-fetcher-schema.txt
index a559d0f..5bf03ce 100644
--- a/src/test/resources/failing-fetcher-schema.txt
+++ b/src/test/resources/failing-fetcher-schema.txt
@@ -16,6 +16,8 @@
 # * under the License.
 
 # This directive maps fields to our Sling data fetchers
+# It is not needed anymore since SLING-10375, but still supported
+# for backwards compatiblity with existing schemas.
 directive @fetcher(
     name : String,
     options : String = "",
diff --git a/src/test/resources/initial-content/apps/graphql/test/two/GQLschema.jsp b/src/test/resources/initial-content/apps/graphql/test/two/GQLschema.jsp
index ec3fb81..fae8501 100644
--- a/src/test/resources/initial-content/apps/graphql/test/two/GQLschema.jsp
+++ b/src/test/resources/initial-content/apps/graphql/test/two/GQLschema.jsp
@@ -18,6 +18,8 @@
 --%>
 
 # This directive maps fields to our Sling data fetchers
+# It is not needed anymore since SLING-10375, but still supported
+# for backwards compatiblity with existing schemas.
 directive @fetcher(
     name : String,
     options : String = "",
@@ -32,4 +34,4 @@ type SlingResource {
   path: String
   resourceType: String
   name: String
-}
\ No newline at end of file
+}
diff --git a/src/test/resources/initial-content/apps/graphql/test/two/testing.GQLschema.jsp b/src/test/resources/initial-content/apps/graphql/test/two/testing.GQLschema.jsp
index b0cf1da..ec31f69 100644
--- a/src/test/resources/initial-content/apps/graphql/test/two/testing.GQLschema.jsp
+++ b/src/test/resources/initial-content/apps/graphql/test/two/testing.GQLschema.jsp
@@ -18,6 +18,8 @@
 --%>
 
 # This directive maps fields to our Sling data fetchers
+# It is not needed anymore since SLING-10375, but still supported
+# for backwards compatiblity with existing schemas.
 directive @fetcher(
     name : String,
     options : String = "",
@@ -30,4 +32,4 @@ type Query {
 
 type TestData {
   farenheit: Int @fetcher(name:"test/pipe" options:"farenheit")
-}
\ No newline at end of file
+}