private static function findSlug(array $classMetadata): string
    {
        foreach ($classMetadata as $name => $info) {
            if ($info['type'] === 'Slug') {
                return $name;
            }
        }
        throw new InvalidFetchFieldsQueryException("Class doesn't have a slug field");
    }