Skip to content

Commit

Permalink
Merge pull request #782 from sangria-graphql/ExecutionPath_cacheKeyRe…
Browse files Browse the repository at this point in the history
…versedIterator

introduce ExecutionPath.cacheKeyReversedIterator
  • Loading branch information
yanns authored Nov 3, 2021
2 parents 21d83e0 + 40ef50a commit 3eb4c9c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class ExecutionPath private (

def cacheKey: ExecutionPath.PathCacheKey = cacheKeyPath.reverseIterator.toVector
def cacheKeyReversed: ExecutionPath.PathCacheKeyReversed = cacheKeyPath
def cacheKeyReversedIterator: Iterator[String] = cacheKeyPath.iterator

override def toString: String = _path.reverseIterator
.foldLeft(new StringBuilder) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@ class DeprecationTrackerSpec
deprecationTracker.ctx.get.path.path should be(Vector("nested", "aa", "bb"))
deprecationTracker.ctx.get.path.cacheKey should be(
Vector("nested", "TestType", "aa", "TestType", "bb", "TestType"))
deprecationTracker.ctx.get.path.cacheKeyReversed should be(
List("TestType", "bb", "TestType", "aa", "TestType", "nested"))
deprecationTracker.ctx.get.path.cacheKeyReversedIterator.toList should be(
List("TestType", "bb", "TestType", "aa", "TestType", "nested"))
deprecationTracker.ctx.get.field.name should be("deprecated")
deprecationTracker.ctx.get.parentType.name should be("TestType")
}
Expand Down

0 comments on commit 3eb4c9c

Please sign in to comment.