Skip to content

Commit 668c6f9

Browse files
authored
Merge pull request #910 from graphql-java-kickstart/feature/858-deprecate-introspection-enabled
Deprecate the introspectionEnabled option
2 parents 5af66a5 + c3665d8 commit 668c6f9

3 files changed

Lines changed: 5 additions & 1 deletion

File tree

‎src/main/kotlin/graphql/kickstart/tools/SchemaParser.kt‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,11 @@ class SchemaParser internal constructor(
7979
* Parses the given schema with respect to the given dictionary and returns GraphQL objects.
8080
*/
8181
fun parseSchemaObjects(): SchemaObjects {
82+
@Suppress("DEPRECATION")
8283
if (!options.introspectionEnabled) {
8384
// What the deprecated NoIntrospectionGraphqlFieldVisibility does. Its suggested replacement,
8485
// Introspection.enabledJvmWide, would also turn introspection off for every other schema in the JVM.
85-
// TODO deprecate introspectionEnabled and remove this in 15.0.0 (#858)
86+
// TODO remove this in 15.0.0 (#858)
8687
codeRegistryBuilder.fieldVisibility(BlockedFields.newBlock().addPattern("__.*").build())
8788
}
8889
// this overrides the above introspection enabled setting obviously... todo: add documentation

‎src/main/kotlin/graphql/kickstart/tools/SchemaParserOptions.kt‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ data class SchemaParserOptions internal constructor(
3131
val proxyHandlers: List<ProxyHandler>,
3232
val inputArgumentOptionalDetectOmission: Boolean,
3333
val preferGraphQLResolver: Boolean,
34+
@Deprecated("Will be removed in 15.0.0. Use Introspection.enabledJvmWide(false) for the whole JVM, or put Introspection.INTROSPECTION_DISABLED in the GraphQLContext of the request.")
3435
val introspectionEnabled: Boolean,
3536
val coroutineContextProvider: CoroutineContextProvider,
3637
val typeDefinitionFactories: List<TypeDefinitionFactory>,
@@ -128,6 +129,7 @@ data class SchemaParserOptions internal constructor(
128129
this.proxyHandlers.add(proxyHandler)
129130
}
130131

132+
@Deprecated("Will be removed in 15.0.0. Use Introspection.enabledJvmWide(false) for the whole JVM, or put Introspection.INTROSPECTION_DISABLED in the GraphQLContext of the request.")
131133
fun introspectionEnabled(introspectionEnabled: Boolean) = this.apply {
132134
this.introspectionEnabled = introspectionEnabled
133135
}

‎src/test/kotlin/graphql/kickstart/tools/IntrospectionTest.kt‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import org.junit.Test
99

1010
class IntrospectionTest {
1111

12+
@Suppress("DEPRECATION")
1213
private fun graphQL(introspectionEnabled: Boolean): GraphQL {
1314
val schema = SchemaParser.newParser()
1415
.schemaString(

0 commit comments

Comments
 (0)