remove unused method
Project: http://git-wip-us.apache.org/repos/asf/incubator-s2graph/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-s2graph/commit/717b9b88 Tree: http://git-wip-us.apache.org/repos/asf/incubator-s2graph/tree/717b9b88 Diff: http://git-wip-us.apache.org/repos/asf/incubator-s2graph/diff/717b9b88 Branch: refs/heads/master Commit: 717b9b8858f6f01cf52396e983f2cb4497049e72 Parents: eb130d4 Author: daewon <[email protected]> Authored: Fri Mar 9 10:19:53 2018 +0900 Committer: daewon <[email protected]> Committed: Fri Mar 9 10:19:53 2018 +0900 ---------------------------------------------------------------------- .../org/apache/s2graph/core/mysqls/Label.scala | 5 ---- .../graphql/repository/GraphRepository.scala | 7 +++--- .../graphql/types/S2ManagementType.scala | 4 +-- .../apache/s2graph/graphql/ScenarioTest.scala | 26 +++++++++++++++++++- 4 files changed, 30 insertions(+), 12 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-s2graph/blob/717b9b88/s2core/src/main/scala/org/apache/s2graph/core/mysqls/Label.scala ---------------------------------------------------------------------- diff --git a/s2core/src/main/scala/org/apache/s2graph/core/mysqls/Label.scala b/s2core/src/main/scala/org/apache/s2graph/core/mysqls/Label.scala index d40c4a7..c128163 100644 --- a/s2core/src/main/scala/org/apache/s2graph/core/mysqls/Label.scala +++ b/s2core/src/main/scala/org/apache/s2graph/core/mysqls/Label.scala @@ -229,11 +229,6 @@ object Label extends Model[Label] { newLabel.getOrElse(throw new RuntimeException("failed to create label")) } - def findAllWithoutCache()(implicit session: DBSession = AutoSession) = { - val ls = sql"""select * from labels where deleted_at is null""".map { rs => Label(rs) }.list().apply() - ls - } - def findAll()(implicit session: DBSession = AutoSession) = { val ls = sql"""select * from labels where deleted_at is null""".map { rs => Label(rs) }.list().apply() http://git-wip-us.apache.org/repos/asf/incubator-s2graph/blob/717b9b88/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 05b65d6..6c9158c 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 @@ -258,14 +258,13 @@ class GraphRepository(val graph: S2GraphLike) { Management.deleteLabel(labelName) } - def allServices: List[Service] = Service.findAll() + def allServices(): List[Service] = Service.findAll() - def allServiceColumns: List[ServiceColumn] = ServiceColumn.findAll() + def allServiceColumns(): List[ServiceColumn] = ServiceColumn.findAll() def findServiceByName(name: String): Option[Service] = Service.findByName(name) - def allLabels(useCache: Boolean = false): List[Label] = - if (useCache) Label.findAll() else Label.findAllWithoutCache() + def allLabels() = Label.findAll() def findLabelByName(name: String): Option[Label] = Label.findByName(name) http://git-wip-us.apache.org/repos/asf/incubator-s2graph/blob/717b9b88/s2graphql/src/main/scala/org/apache/s2graph/graphql/types/S2ManagementType.scala ---------------------------------------------------------------------- diff --git a/s2graphql/src/main/scala/org/apache/s2graph/graphql/types/S2ManagementType.scala b/s2graphql/src/main/scala/org/apache/s2graph/graphql/types/S2ManagementType.scala index 2e28ef1..51cc448 100644 --- a/s2graphql/src/main/scala/org/apache/s2graph/graphql/types/S2ManagementType.scala +++ b/s2graphql/src/main/scala/org/apache/s2graph/graphql/types/S2ManagementType.scala @@ -107,7 +107,7 @@ class S2ManagementType(repo: GraphRepository) { ) } - lazy val labelPropsInputFields = repo.allLabels(false).map { label => + lazy val labelPropsInputFields = repo.allLabels().map { label => InputField(label.label, OptionInputType(InputObjectType( s"Input_${label.label}_props", description = "desc here", @@ -161,7 +161,7 @@ class S2ManagementType(repo: GraphRepository) { s"Enum_Label", description = Option("desc here"), values = - dummyEnum +: repo.allLabels(false).map { label => + dummyEnum +: repo.allLabels().map { label => EnumValue(label.label, value = label.label) } ) http://git-wip-us.apache.org/repos/asf/incubator-s2graph/blob/717b9b88/s2graphql/src/test/scala/org/apache/s2graph/graphql/ScenarioTest.scala ---------------------------------------------------------------------- diff --git a/s2graphql/src/test/scala/org/apache/s2graph/graphql/ScenarioTest.scala b/s2graphql/src/test/scala/org/apache/s2graph/graphql/ScenarioTest.scala index 8f86be1..6a06a31 100644 --- a/s2graphql/src/test/scala/org/apache/s2graph/graphql/ScenarioTest.scala +++ b/s2graphql/src/test/scala/org/apache/s2graph/graphql/ScenarioTest.scala @@ -300,7 +300,6 @@ class ScenarioTest extends FunSpec with Matchers with BeforeAndAfterAll { """ val actual = testGraph.queryAsJs(query) - println(actual) val expected = Json.parse( """ { @@ -321,5 +320,30 @@ class ScenarioTest extends FunSpec with Matchers with BeforeAndAfterAll { actual shouldBe expected } } + + describe("Add vertex to kakao.user'") { + val query = + graphql""" + mutation { + addVertex( + labelName: friends + props: { + name: "score" + dataType: float + defaultValue: "0" + storeInGlobalIndex: true + }) + { + isSuccess + } + } + """ + + } + + describe("Add edge to label 'friends'") { + + } + } }
