Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ open class QueryBenchmark {
query("executionError") {
resolver<String> { throw IllegalArgumentException("Execution Error") }
}
query("uppercase") {
resolver { input: String -> input.uppercase() }
}
}

@Benchmark
Expand Down Expand Up @@ -119,6 +122,11 @@ open class QueryBenchmark {
return schema.executeBlocking("{manyChildren{id name children {id name dataParent {id name}}}}")
}

@Benchmark
fun manyChildrenWithFragment(): String {
return schema.executeBlocking("{manyChildren{...IdName children {...IdName parent {...IdName}}}} fragment IdName on Node { id name }")
}

@Benchmark
fun manyOperations(): String {
return schema.executeBlocking(manyOperations)
Expand All @@ -133,4 +141,14 @@ open class QueryBenchmark {
fun executionError(): String {
return runCatching { schema.executeBlocking("{executionError}") }.getOrElse { it.javaClass.simpleName }
}

@Benchmark
fun inputFromDocument(): String {
return schema.executeBlocking("{uppercase(input: \"foobar\")}")
}

@Benchmark
fun inputFromVariable(): String {
return schema.executeBlocking("query(\$inputVar: String!) {uppercase(input: \$inputVar)}", "{\"inputVar\": \"foobar\"}")
}
}
Loading