add distinct

Project: http://git-wip-us.apache.org/repos/asf/incubator-s2graph/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-s2graph/commit/c8d30051
Tree: http://git-wip-us.apache.org/repos/asf/incubator-s2graph/tree/c8d30051
Diff: http://git-wip-us.apache.org/repos/asf/incubator-s2graph/diff/c8d30051

Branch: refs/heads/master
Commit: c8d30051d193d88fa4f6f076836b29fba488b465
Parents: 597b853
Author: daewon <[email protected]>
Authored: Tue Jul 10 18:30:34 2018 +0900
Committer: daewon <[email protected]>
Committed: Tue Jul 10 18:30:34 2018 +0900

----------------------------------------------------------------------
 .../org/apache/s2graph/graphql/repository/GraphRepository.scala | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-s2graph/blob/c8d30051/s2graphql/src/main/scala/org/apache/s2graph/graphql/repository/GraphRepository.scala
----------------------------------------------------------------------
diff --git 
a/s2graphql/src/main/scala/org/apache/s2graph/graphql/repository/GraphRepository.scala
 
b/s2graphql/src/main/scala/org/apache/s2graph/graphql/repository/GraphRepository.scala
index bd98504..1bac416 100644
--- 
a/s2graphql/src/main/scala/org/apache/s2graph/graphql/repository/GraphRepository.scala
+++ 
b/s2graphql/src/main/scala/org/apache/s2graph/graphql/repository/GraphRepository.scala
@@ -279,7 +279,7 @@ class GraphRepository(val graph: S2GraphLike) {
   }
 
   def services(): List[Service] = {
-    Service.findAll()
+    Service.findAll().distinct
   }
 
   def serviceColumns(): List[ServiceColumn] = {
@@ -288,6 +288,7 @@ class GraphRepository(val graph: S2GraphLike) {
     ServiceColumn
       .findAll()
       .filter(sc => allServices(sc.service))
+      .distinct
   }
 
   def labels() = {
@@ -296,6 +297,6 @@ class GraphRepository(val graph: S2GraphLike) {
     Label
       .findAll()
       .filter(l => allServiceColumns(l.srcColumn) || 
allServiceColumns(l.tgtColumn))
+      .distinct
   }
-
 }

Reply via email to