protected function getSuggestedTypeNames(Schema $schema, TypeInterface $type, string $fieldName): array
    {
        if (!$type instanceof AbstractTypeInterface) {
            // Otherwise, must be an Object type, which does not have possible fields.
            return [];
        }

        $suggestedObjectTypes = [];
        $interfaceUsageCount  = [];

        foreach ($schema->getPossibleTypes($type) as $possibleType) {
            if (!$possibleType instanceof FieldsAwareInterface) {
                continue;
            }

            $typeFields = $possibleType->getFields();

            if (!isset($typeFields[$fieldName])) {
                break;
            }

            if (!$possibleType instanceof NamedTypeInterface) {
                continue;
            }

            $suggestedObjectTypes[] = $possibleType->getName();

            if (!$possibleType instanceof ObjectType) {
                continue;
            }

            foreach ($possibleType->getInterfaces() as $possibleInterface) {
                $interfaceFields = $possibleInterface->getFields();

                if (!isset($interfaceFields[$fieldName])) {
                    break;
                }

                $interfaceName                       = $possibleInterface->getName();
                $interfaceUsageCount[$interfaceName] = ($interfaceUsageCount[$interfaceName] ?? 0) + 1;
            }
        }

        $suggestedInterfaceTypes = \array_keys($interfaceUsageCount);

        \uasort($suggestedInterfaceTypes, function ($a, $b) use ($interfaceUsageCount) {
            return $interfaceUsageCount[$b] - $interfaceUsageCount[$a];
        });

        return \array_merge($suggestedInterfaceTypes, $suggestedObjectTypes);
    }