Skip to content

Commit 1733ae6

Browse files
committed
Better name
1 parent 12e7534 commit 1733ae6

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

‎src/main/java/graphql/normalized/ExecutableNormalizedField.java‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ public boolean isConditional(@NotNull GraphQLSchema schema) {
137137
return false;
138138
}
139139

140-
for (GraphQLInterfaceType commonParentOutputInterface : parent.getCommonOutputInterfaces(schema)) {
140+
for (GraphQLInterfaceType commonParentOutputInterface : parent.getInterfacesCommonToAllOutputTypes(schema)) {
141141
List<GraphQLObjectType> implementations = schema.getImplementations(commonParentOutputInterface);
142142
// __typename
143143
if (fieldName.equals(Introspection.TypeNameMetaFieldDef.getName()) && implementations.size() == objectTypeNames.size()) {
@@ -504,12 +504,16 @@ private void traverseImpl(ExecutableNormalizedField root,
504504
}
505505

506506
/**
507-
* This tries to find interfaces common to all the PARENT field output types.
507+
* This tries to find interfaces common to all the field output types.
508+
* <p>
509+
* i.e. goes through {@link #getFieldDefinitions(GraphQLSchema)} and finds an interface that
510+
* all the field's unwrapped output types are assignable to.
508511
*/
509512
@SuppressWarnings({"unchecked", "rawtypes"})
510-
private Set<GraphQLInterfaceType> getCommonOutputInterfaces(GraphQLSchema schema) {
513+
private Set<GraphQLInterfaceType> getInterfacesCommonToAllOutputTypes(GraphQLSchema schema) {
511514
Ref<Set<GraphQLInterfaceType>> ref = new Ref<>();
512515

516+
// Shortcut for performance
513517
if (objectTypeNames.size() == 1) {
514518
var fieldDef = getOneFieldDefinition(schema);
515519
var outputType = unwrapAll(fieldDef.getType());

0 commit comments

Comments
 (0)