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 2020/06/03 12:07:42 UTC

[sling-samples] branch master updated (cf34d2a -> 40c90c1)

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-samples.git.


    from cf34d2a  SLING-9479 - adapt schema comments to avoid 'fetch:' in type/field descriptions
     new ffe6dcc  .gitignore
     new 40c90c1  Use schema directives as per GraphQL core module changes

The 2 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:
 org.apache.sling.graphql.samples.website/.gitignore           |  1 +
 .../initial-content/apps/samples/article/GQLschema.jsp        |  6 +++---
 .../initial-content/apps/samples/common/GQLschema.jsp         | 11 +++++------
 .../apps/samples/common/common-query-parts.jsp                |  3 +--
 .../samples/common/{common-query-parts.jsp => directives.jsp} |  8 ++++++--
 .../initial-content/apps/samples/section/GQLschema.jsp        |  6 +++---
 .../initial-content/apps/samples/servlet/GQLschema.jsp        |  6 +++---
 .../SLING-INF/initial-content/apps/samples/tag/GQLschema.jsp  |  6 +++---
 8 files changed, 25 insertions(+), 22 deletions(-)
 copy org.apache.sling.graphql.samples.website/src/main/resources/SLING-INF/initial-content/apps/samples/common/{common-query-parts.jsp => directives.jsp} (82%)


[sling-samples] 02/02: Use schema directives as per GraphQL core module changes

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-samples.git

commit 40c90c1eac335c7738031be91761b131f06da3f1
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Wed Jun 3 14:02:19 2020 +0200

    Use schema directives as per GraphQL core module changes
---
 .../initial-content/apps/samples/article/GQLschema.jsp        |  6 +++---
 .../initial-content/apps/samples/common/GQLschema.jsp         | 11 +++++------
 .../apps/samples/common/common-query-parts.jsp                |  3 +--
 .../samples/common/{common-query-parts.jsp => directives.jsp} |  8 ++++++--
 .../initial-content/apps/samples/section/GQLschema.jsp        |  6 +++---
 .../initial-content/apps/samples/servlet/GQLschema.jsp        |  6 +++---
 .../SLING-INF/initial-content/apps/samples/tag/GQLschema.jsp  |  6 +++---
 7 files changed, 24 insertions(+), 22 deletions(-)

diff --git a/org.apache.sling.graphql.samples.website/src/main/resources/SLING-INF/initial-content/apps/samples/article/GQLschema.jsp b/org.apache.sling.graphql.samples.website/src/main/resources/SLING-INF/initial-content/apps/samples/article/GQLschema.jsp
index 4623eb3..446d209 100644
--- a/org.apache.sling.graphql.samples.website/src/main/resources/SLING-INF/initial-content/apps/samples/article/GQLschema.jsp
+++ b/org.apache.sling.graphql.samples.website/src/main/resources/SLING-INF/initial-content/apps/samples/article/GQLschema.jsp
@@ -17,11 +17,11 @@
 * under the License.
 --%>
 
+<%@include file="../common/directives.jsp" %>
+
 type Query {
-  ## fetch:samples/currentResource
-  #
   # The current Article
-  article : Article
+  article : Article @fetcher(name:"samples/currentResource")
 
   <%@include file="../common/common-query-parts.jsp" %>
 }
diff --git a/org.apache.sling.graphql.samples.website/src/main/resources/SLING-INF/initial-content/apps/samples/common/GQLschema.jsp b/org.apache.sling.graphql.samples.website/src/main/resources/SLING-INF/initial-content/apps/samples/common/GQLschema.jsp
index 01ced46..abfeb49 100644
--- a/org.apache.sling.graphql.samples.website/src/main/resources/SLING-INF/initial-content/apps/samples/common/GQLschema.jsp
+++ b/org.apache.sling.graphql.samples.website/src/main/resources/SLING-INF/initial-content/apps/samples/common/GQLschema.jsp
@@ -20,6 +20,9 @@
 # This is the common parts of our "samples" schemas
 # It is included (using JSP includes for now) in
 # the resourceType-specific schemas
+#
+# The directives.jsp schema fragment must be loaded
+# before this one.
 
 # Website navigation  information
 type Navigation {
@@ -38,10 +41,8 @@ type Section {
   name: String
   path: String
   
-  ## fetch:samples/articlesBySection
-  #
   # List of articles in this section
-  articles: [Article]
+  articles: [Article] @fetcher(name:"samples/articlesBySection")
 }
 
 # Articles are the core content of our website
@@ -52,10 +53,8 @@ type Article {
   tags: [String]
   text: String
 
-  ## fetch:samples/seeAlso
-  #
   # List of "See Also" articles
-  seeAlso: [Article]
+  seeAlso: [Article] @fetcher(name:"samples/seeAlso")
 }
 
 # A query for articles which have specific tags
diff --git a/org.apache.sling.graphql.samples.website/src/main/resources/SLING-INF/initial-content/apps/samples/common/common-query-parts.jsp b/org.apache.sling.graphql.samples.website/src/main/resources/SLING-INF/initial-content/apps/samples/common/common-query-parts.jsp
index 0cd833f..d050048 100644
--- a/org.apache.sling.graphql.samples.website/src/main/resources/SLING-INF/initial-content/apps/samples/common/common-query-parts.jsp
+++ b/org.apache.sling.graphql.samples.website/src/main/resources/SLING-INF/initial-content/apps/samples/common/common-query-parts.jsp
@@ -17,5 +17,4 @@
 * under the License.
 --%>
 
-## fetch:samples/navigation
-navigation: Navigation
+navigation: Navigation @fetcher(name:"samples/navigation")
diff --git a/org.apache.sling.graphql.samples.website/src/main/resources/SLING-INF/initial-content/apps/samples/common/common-query-parts.jsp b/org.apache.sling.graphql.samples.website/src/main/resources/SLING-INF/initial-content/apps/samples/common/directives.jsp
similarity index 82%
copy from org.apache.sling.graphql.samples.website/src/main/resources/SLING-INF/initial-content/apps/samples/common/common-query-parts.jsp
copy to org.apache.sling.graphql.samples.website/src/main/resources/SLING-INF/initial-content/apps/samples/common/directives.jsp
index 0cd833f..368398d 100644
--- a/org.apache.sling.graphql.samples.website/src/main/resources/SLING-INF/initial-content/apps/samples/common/common-query-parts.jsp
+++ b/org.apache.sling.graphql.samples.website/src/main/resources/SLING-INF/initial-content/apps/samples/common/directives.jsp
@@ -17,5 +17,9 @@
 * under the License.
 --%>
 
-## fetch:samples/navigation
-navigation: Navigation
+# This directive maps fields to our Sling data fetchers
+directive @fetcher(
+    name : String,
+    options : String = "",
+    source : String = ""
+) on FIELD_DEFINITION
\ No newline at end of file
diff --git a/org.apache.sling.graphql.samples.website/src/main/resources/SLING-INF/initial-content/apps/samples/section/GQLschema.jsp b/org.apache.sling.graphql.samples.website/src/main/resources/SLING-INF/initial-content/apps/samples/section/GQLschema.jsp
index a9dc531..17331b7 100644
--- a/org.apache.sling.graphql.samples.website/src/main/resources/SLING-INF/initial-content/apps/samples/section/GQLschema.jsp
+++ b/org.apache.sling.graphql.samples.website/src/main/resources/SLING-INF/initial-content/apps/samples/section/GQLschema.jsp
@@ -17,11 +17,11 @@
 * under the License.
 --%>
 
+<%@include file="../common/directives.jsp" %>
+
 type Query {
-  ## fetch:samples/currentResource
-  #
   # The current content section
-  section: Section
+  section: Section @fetcher(name:"samples/currentResource")
 
   <%@include file="../common/common-query-parts.jsp" %>
 }
diff --git a/org.apache.sling.graphql.samples.website/src/main/resources/SLING-INF/initial-content/apps/samples/servlet/GQLschema.jsp b/org.apache.sling.graphql.samples.website/src/main/resources/SLING-INF/initial-content/apps/samples/servlet/GQLschema.jsp
index 1336e49..63514de 100644
--- a/org.apache.sling.graphql.samples.website/src/main/resources/SLING-INF/initial-content/apps/samples/servlet/GQLschema.jsp
+++ b/org.apache.sling.graphql.samples.website/src/main/resources/SLING-INF/initial-content/apps/samples/servlet/GQLschema.jsp
@@ -17,11 +17,11 @@
 * under the License.
 --%>
 
+<%@include file="../common/directives.jsp" %>
+
 type Query {
-  ## fetch:samples/articlesWithText
-  #
   # List of Articles which contain the supplied text
-  article (withText : String) : [Article]
+  article (withText : String) : [Article] @fetcher(name:"samples/articlesWithText")
 }
 
 <%@include file="/apps/samples/common/GQLschema.jsp" %>
\ No newline at end of file
diff --git a/org.apache.sling.graphql.samples.website/src/main/resources/SLING-INF/initial-content/apps/samples/tag/GQLschema.jsp b/org.apache.sling.graphql.samples.website/src/main/resources/SLING-INF/initial-content/apps/samples/tag/GQLschema.jsp
index bcfc571..519afef 100644
--- a/org.apache.sling.graphql.samples.website/src/main/resources/SLING-INF/initial-content/apps/samples/tag/GQLschema.jsp
+++ b/org.apache.sling.graphql.samples.website/src/main/resources/SLING-INF/initial-content/apps/samples/tag/GQLschema.jsp
@@ -17,12 +17,12 @@
 * under the License.
 --%>
 
+<%@include file="../common/directives.jsp" %>
+
 type Query {
-  ## fetch:samples/tagQuery
-  #
   # Find articles which have the current
   # set of tags
-  tagQuery: TagQuery
+  tagQuery: TagQuery @fetcher(name:"samples/tagQuery")
 
   <%@include file="../common/common-query-parts.jsp" %>
 }


[sling-samples] 01/02: .gitignore

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-samples.git

commit ffe6dcc3b94f5537e0749549e52d005d13a5ce59
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Wed Jun 3 14:01:28 2020 +0200

    .gitignore
---
 org.apache.sling.graphql.samples.website/.gitignore | 1 +
 1 file changed, 1 insertion(+)

diff --git a/org.apache.sling.graphql.samples.website/.gitignore b/org.apache.sling.graphql.samples.website/.gitignore
index f87a37c..5c41ccd 100644
--- a/org.apache.sling.graphql.samples.website/.gitignore
+++ b/org.apache.sling.graphql.samples.website/.gitignore
@@ -1,2 +1,3 @@
 conf/
 launcher/
+.vscode/