diff --git a/lib/src/main/java/graphql/nadel/validation/NadelAssignableTypeValidation.kt b/lib/src/main/java/graphql/nadel/validation/NadelAssignableTypeValidation.kt index 6a3c01e1a..7b7d6cc43 100644 --- a/lib/src/main/java/graphql/nadel/validation/NadelAssignableTypeValidation.kt +++ b/lib/src/main/java/graphql/nadel/validation/NadelAssignableTypeValidation.kt @@ -11,6 +11,7 @@ class NadelAssignableTypeValidation internal constructor( overallType: GraphQLType, underlyingType: GraphQLType, ): Boolean { + // Note: the (supplied) value comes from the underlying service, and that value needs to fit the (required) overall field's type return isTypeAssignable( suppliedType = underlyingType, requiredType = overallType, @@ -25,6 +26,7 @@ class NadelAssignableTypeValidation internal constructor( overallType: GraphQLType, underlyingType: GraphQLType, ): Boolean { + // Note: the (supplied) value comes from the user (overall schema) and needs to be assigned to the (required) underlying type return isTypeAssignable( suppliedType = overallType, requiredType = underlyingType, diff --git a/lib/src/main/java/graphql/nadel/validation/NadelFieldValidation.kt b/lib/src/main/java/graphql/nadel/validation/NadelFieldValidation.kt index e668711b3..003917211 100644 --- a/lib/src/main/java/graphql/nadel/validation/NadelFieldValidation.kt +++ b/lib/src/main/java/graphql/nadel/validation/NadelFieldValidation.kt @@ -91,8 +91,6 @@ class NadelFieldValidation internal constructor( if (underlyingArg == null) { MissingArgumentOnUnderlying(parent, overallField, underlyingField, overallArg) } else { - // Note: the value comes from the user (overall schema) - // So we are supplying the overall argument to the underlying argument val isArgumentTypeAssignable = assignableTypeValidation.isInputTypeAssignable( overallType = overallArg.type, underlyingType = underlyingArg.type @@ -181,7 +179,6 @@ class NadelFieldValidation internal constructor( overallField: GraphQLFieldDefinition, underlyingField: GraphQLFieldDefinition, ): NadelSchemaValidationResult { - // Note: the value comes from the underlying schema, so we are supplying the underlying field to the overall field val isUnderlyingTypeAssignable = assignableTypeValidation.isOutputTypeAssignable( overallType = overallField.type, underlyingType = underlyingField.type, diff --git a/lib/src/main/java/graphql/nadel/validation/NadelVirtualTypeValidation.kt b/lib/src/main/java/graphql/nadel/validation/NadelVirtualTypeValidation.kt index eedda87ee..b1372b332 100644 --- a/lib/src/main/java/graphql/nadel/validation/NadelVirtualTypeValidation.kt +++ b/lib/src/main/java/graphql/nadel/validation/NadelVirtualTypeValidation.kt @@ -165,7 +165,6 @@ class NadelVirtualTypeValidation internal constructor( ) } - // Note: the value comes from the backing field, and that value needs to fit the virtual field val isOutputTypeAssignable = isOutputTypeAssignable( backingField = backingField, virtualField = virtualField, @@ -288,6 +287,7 @@ class NadelVirtualTypeValidation internal constructor( backingField: GraphQLFieldDefinition, virtualField: GraphQLFieldDefinition, ): Boolean { + // Note: the (supplied) value comes from the backing service, and that value needs to fit the (required) virtual field's type val suppliedType = backingField.type val requiredType = virtualField.type