ensure DFEImpl graphql context is never null by andimarek · Pull Request #4004 · graphql-java/graphql-java

Expand Up @@ -2,6 +2,7 @@

import com.google.common.collect.ImmutableMap; import graphql.Assert; import graphql.GraphQLContext; import graphql.Internal; import graphql.collect.ImmutableKit; Expand Down Expand Up @@ -60,7 +61,7 @@ private DataFetchingEnvironmentImpl(Builder builder) { this.source = builder.source; this.arguments = builder.arguments == null ? ImmutableKit::emptyMap : builder.arguments; this.context = builder.context; this.graphQLContext = builder.graphQLContext; this.graphQLContext = Assert.assertNotNull(builder.graphQLContext); this.localContext = builder.localContext; this.root = builder.root; this.fieldDefinition = builder.fieldDefinition; Expand Down Expand Up @@ -266,7 +267,7 @@ public static class Builder {
private Object source; private Object context; private GraphQLContext graphQLContext; private GraphQLContext graphQLContext = GraphQLContext.newContext().build(); private Object localContext; private Object root; private GraphQLFieldDefinition fieldDefinition; Expand Down