Skip to content

Commit 80fdb81

Browse files
committed
minor cleanups
1 parent 9893b11 commit 80fdb81

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/main/java/graphql/execution/incremental/IncrementalUtils.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import graphql.execution.ValuesResolver;
88
import graphql.language.Directive;
99
import graphql.language.NodeUtil;
10+
import org.jetbrains.annotations.Nullable;
1011

1112
import java.util.List;
1213
import java.util.Locale;
@@ -20,7 +21,7 @@ public class IncrementalUtils {
2021
private IncrementalUtils() {
2122
}
2223

23-
public static <T> T createDeferredExecution(
24+
public static @Nullable <T> T createDeferredExecution(
2425
Map<String, Object> variables,
2526
List<Directive> directives,
2627
Function<String, T> builderFunction

src/main/java/graphql/normalized/ExecutableNormalizedOperationFactory.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -536,10 +536,11 @@ private void buildEnfsRecursively(@Nullable ExecutableNormalizedField executable
536536
// and is the type to which the field belongs (the container type of the field) and output type
537537
// of the field needs to be determined based on the field name
538538
GraphQLFieldDefinition fieldDefinition = Introspection.getFieldDef(graphQLSchema, fieldAndAstParent.astTypeCondition, fieldAndAstParent.field.getName());
539-
GraphQLUnmodifiedType selectionSetType = unwrapAll(fieldDefinition.getType());
539+
// it must a composite type, because the field has a selection set
540+
GraphQLCompositeType selectionSetType = (GraphQLCompositeType) unwrapAll(fieldDefinition.getType());
540541
this.collectFromSelectionSet(fieldAndAstParent.field.getSelectionSet(),
541542
collectedFields,
542-
(GraphQLCompositeType) selectionSetType,
543+
selectionSetType,
543544
possibleObjects,
544545
null
545546
);
@@ -829,7 +830,7 @@ private void collectInlineFragment(List<CollectedField> result,
829830
collectFromSelectionSet(inlineFragment.getSelectionSet(), result, newAstTypeCondition, newPossibleObjects, newDeferredExecution);
830831
}
831832

832-
private NormalizedDeferredExecution buildDeferredExecution(
833+
private @Nullable NormalizedDeferredExecution buildDeferredExecution(
833834
List<Directive> directives,
834835
Set<GraphQLObjectType> newPossibleObjects) {
835836
if (!options.deferSupport) {

0 commit comments

Comments
 (0)