Skip to content

Commit

Permalink
stash
Browse files Browse the repository at this point in the history
  • Loading branch information
gnawf committed Jan 16, 2024
1 parent 481813d commit 3322112
Showing 1 changed file with 30 additions and 4 deletions.
34 changes: 30 additions & 4 deletions test/src/test/kotlin/graphql/nadel/tests/CentralSchemaTesting.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import com.fasterxml.jackson.module.kotlin.readValue
import graphql.GraphQLError
import graphql.language.AstPrinter
import graphql.nadel.Nadel
import graphql.nadel.NadelExecutionHints
import graphql.nadel.NadelExecutionInput.Companion.newNadelExecutionInput
import graphql.nadel.NadelSchemas
import graphql.nadel.ServiceExecution
Expand Down Expand Up @@ -33,7 +34,7 @@ val File.parents: Sequence<File>
* Set this to true to run the query. You'll have to modify the [ServiceExecutionFactory] to
* actually return something e.g. response from Splunk etc.
*/
const val runQuery = false
const val runQuery = true

/**
* You can use this script to run central schema locally in Nadel without
Expand Down Expand Up @@ -90,8 +91,11 @@ suspend fun main() {
AstPrinter.printAst(it.query).also(::println)

val response: JsonMap = ObjectMapper().readValue(
File("/Users/fwang/Library/Application Support/JetBrains/IntelliJIdea2021.1/scratches/buffer2.kts")
.readText(),
when (serviceName) {
"gira" -> File("/Users/fwang/Library/Application Support/JetBrains/IntelliJIdea2023.2/scratches/scratch_328.json")
.readText()
else -> throw UnsupportedOperationException()
},
)

CompletableFuture.completedFuture(
Expand Down Expand Up @@ -130,7 +134,28 @@ suspend fun main() {
nadel
.execute(
newNadelExecutionInput()
.executionHints(
NadelExecutionHints.Builder()
.newBatchHydrationGrouping { true }
.build()
)
.query(query)
.variables(
mapOf(
"issueKey" to "",
"projectKey" to "",
"cloudId" to "",
"issueViewRelaySingleSelectFlag" to true,
"childIssueIsResolvedFlag" to true,
"giraAGGMigrationJiraSettingsFlag" to true,
"giraAGGMigrationIsArchivedFlag" to true,
"giraAGGMigrationMyPreferencesFlag" to true,
"useChildIssuesLimitFlag" to true,
"parentInIssueViewFlag" to true,
"dataClassificationBadgeFlag" to true,
"isCompassComponentsEnabled" to true,
)
)
.build(),
)
.asDeferred()
Expand All @@ -140,7 +165,8 @@ suspend fun main() {
}
}

const val query = ""
val query = ClassLoader.getSystemResource("CentralSchemaTesting.graphqls")
.readText()

private fun getServiceName(file: File): String? {
val parts: List<File> = splitFileParts(file)
Expand Down

0 comments on commit 3322112

Please sign in to comment.