From 3322112df0f9fb7f5da7ea8cb44e10b960ac8572 Mon Sep 17 00:00:00 2001 From: Franklin Wang Date: Wed, 17 Jan 2024 08:54:55 +1100 Subject: [PATCH] stash --- .../nadel/tests/CentralSchemaTesting.kt | 34 ++++++++++++++++--- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/test/src/test/kotlin/graphql/nadel/tests/CentralSchemaTesting.kt b/test/src/test/kotlin/graphql/nadel/tests/CentralSchemaTesting.kt index f50dbc373..03ce197d7 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/CentralSchemaTesting.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/CentralSchemaTesting.kt @@ -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 @@ -33,7 +34,7 @@ val File.parents: Sequence * 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 @@ -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( @@ -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() @@ -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 = splitFileParts(file)