@@ -6,6 +6,7 @@ import graphql.schema.*
66import graphql.schema.idl.RuntimeWiring
77import graphql.schema.idl.ScalarInfo
88import graphql.schema.idl.SchemaGeneratorHelper
9+ import graphql.schema.visibility.NoIntrospectionGraphqlFieldVisibility
910import org.slf4j.LoggerFactory
1011import java.util.*
1112import kotlin.reflect.KClass
@@ -62,9 +63,13 @@ class SchemaParser internal constructor(scanResult: ScannedSchemaObjects, privat
6263 * Parses the given schema with respect to the given dictionary and returns GraphQL objects.
6364 */
6465 fun parseSchemaObjects (): SchemaObjects {
66+ if (! options.introspectionEnabled) {
67+ codeRegistryBuilder.fieldVisibility(NoIntrospectionGraphqlFieldVisibility .NO_INTROSPECTION_FIELD_VISIBILITY )
68+ }
69+ // this overrides the above introspection enabled setting obviously... todo: add documentation
70+ options.fieldVisilibity?.let { codeRegistryBuilder.fieldVisibility(it) }
6571
6672 // Create GraphQL objects
67- // val inputObjects = inputObjectDefinitions.map { createInputObject(it, listOf())}
6873 val inputObjects: MutableList <GraphQLInputObjectType > = mutableListOf ()
6974 inputObjectDefinitions.forEach {
7075 if (inputObjects.none { io -> io.name == it.name }) {
@@ -101,7 +106,7 @@ class SchemaParser internal constructor(scanResult: ScannedSchemaObjects, privat
101106 /* *
102107 * Parses the given schema with respect to the given dictionary and returns a GraphQLSchema
103108 */
104- fun makeExecutableSchema (): GraphQLSchema = parseSchemaObjects().toSchema(options.introspectionEnabled )
109+ fun makeExecutableSchema (): GraphQLSchema = parseSchemaObjects().toSchema()
105110
106111 /* *
107112 * Returns any unused type definitions that were found in the schema
0 commit comments