diff --git a/src/main/java/graphql/schema/GraphQLSchema.java b/src/main/java/graphql/schema/GraphQLSchema.java index bf4f5098ec..8ddc2065ec 100644 --- a/src/main/java/graphql/schema/GraphQLSchema.java +++ b/src/main/java/graphql/schema/GraphQLSchema.java @@ -69,7 +69,7 @@ public class GraphQLSchema { private final @Nullable SchemaDefinition definition; private final ImmutableList extensionDefinitions; private final @Nullable String description; - private final @Nullable GraphQLCodeRegistry codeRegistry; + private final GraphQLCodeRegistry codeRegistry; private final ImmutableMap typeMap; private final ImmutableMap> interfaceNameToObjectTypes; @@ -77,7 +77,7 @@ public class GraphQLSchema { /* * This constructs partial GraphQL schema object which has the schema (query / mutation / subscription) trees - * in it but it does not have the collected types, code registry nor the type references replaced + * in it but it does not have the collected types, the correct code registry nor the type references replaced * * But it can be traversed to discover all that and filled out later via another constructor. * @@ -102,7 +102,7 @@ private GraphQLSchema(Builder builder) { this.extensionDefinitions = nonNullCopyOf(builder.extensionDefinitions); this.description = builder.description; - this.codeRegistry = null; + this.codeRegistry = builder.codeRegistry; this.typeMap = ImmutableKit.emptyMap(); this.interfaceNameToObjectTypes = ImmutableKit.emptyMap(); this.interfaceNameToObjectTypeNames = ImmutableKit.emptyMap(); @@ -254,7 +254,7 @@ private static ImmutableMap> buildInterfacesToObje return map.build(); } - public @Nullable GraphQLCodeRegistry getCodeRegistry() { + public GraphQLCodeRegistry getCodeRegistry() { return codeRegistry; }