public static function compareTypes(TypeInterface $typeA, TypeInterface $typeB): bool
    {
        if ($typeA instanceof ListType) {
            return $typeB instanceof ListType
                ? self::compareTypes($typeA->getOfType(), $typeB->getOfType())
                : true;
        }
        if ($typeB instanceof ListType) {
            return true;
        }
        if ($typeA instanceof NonNullType) {
            return $typeB instanceof NonNullType
                ? self::compareTypes($typeA->getOfType(), $typeB->getOfType())
                : true;
        }
        if ($typeB instanceof NonNullType) {
            return true;
        }
        if ($typeA instanceof LeafTypeInterface || $typeB instanceof LeafTypeInterface) {
            return $typeA !== $typeB;
        }
        return false;
    }
public static function compareTypes(TypeInterface $typeA, TypeInterface $typeB): bool
    {
        if ($typeA instanceof ListType) {
            return $typeB instanceof ListType
                ? self::compareTypes($typeA->getOfType(), $typeB->getOfType())
                : true;
        }
        if ($typeB instanceof ListType) {
            return true;
        }
        if ($typeA instanceof NonNullType) {
            return $typeB instanceof NonNullType
                ? self::compareTypes($typeA->getOfType(), $typeB->getOfType())
                : true;
        }
        if ($typeB instanceof NonNullType) {
            return true;
        }
        if ($typeA instanceof LeafTypeInterface || $typeB instanceof LeafTypeInterface) {
            return $typeA !== $typeB;
        }
        return false;
    }
public static function compareTypes ( TypeInterface $ typeA , TypeInterface $ typeB ) : bool { if ( $ typeA instanceof ListType ) { return $ typeB instanceof ListType ? self :: compareTypes ( $ typeA -> getOfType ( ) , $ typeB -> getOfType ( ) ) : true ; } if ( $ typeB instanceof ListType ) { return true ; } if ( $ typeA instanceof NonNullType ) { return $ typeB instanceof NonNullType ? self :: compareTypes ( $ typeA -> getOfType ( ) , $ typeB -> getOfType ( ) ) : true ; } if ( $ typeB instanceof NonNullType ) { return true ; } if ( $ typeA instanceof LeafTypeInterface || $ typeB instanceof LeafTypeInterface ) { return $ typeA !== $ typeB ; } return false ; }
Two types conflict if both types could not apply to a value simultaneously.
Composite types are ignored as their individual field types will be compared
later recursively. However List and Non-Null types must match.

@param TypeInterface $typeA
@param TypeInterface $typeB
@return bool
Two types conflict if both types could not apply to a value simultaneously . Composite types are ignored as their individual field types will be compared later recursively . However List and Non - Null types must match .