public function resolveAccessor(
        string $fieldName,
        EntityDefinition $definition,
        string $root,
        QueryBuilder $query,
        Context $context
    ): void {
        $fieldName = str_replace('extensions.', '', $fieldName);

        //example: `product.manufacturer.media.name`
        $original = $fieldName;
        $prefix = $root . '.';

        if (strpos($fieldName, $prefix) === 0) {
            $fieldName = substr($fieldName, \strlen($prefix));
        }

        $fields = $definition->getFields();

        if (!$fields->has($fieldName)) {
            $associationKey = explode('.', $fieldName);
            $fieldName = array_shift($associationKey);
        }

        if (!$fields->has($fieldName)) {
            return;
        }

        /** @var AssociationField|null $field */
        $field = $fields->get($fieldName);

        if ($field === null) {
            return;
        }

        $resolver = $field->getResolver();

        if ($resolver !== null) {
            $resolver->resolve($definition, $root, $field, $query, $context, $this);
        }

        if (!$field instanceof AssociationField) {
            return;
        }

        $referenceDefinition = $field->getReferenceDefinition();
        if ($field instanceof ManyToManyAssociationField) {
            $referenceDefinition = $field->getToManyReferenceDefinition();
        }

        $this->resolveAccessor(
            $original,
            $referenceDefinition,
            $root . '.' . $field->getPropertyName(),
            $query,
            $context
        );
    }