public function resolveReference(array $config)
    {
        $config = $this->normalizeClientConfig($config);

        $middleware = $this->gatherInvokerMiddleware(array_merge(
            $config['client']['middleware'] ?? [],
            $config['middleware'] ?? []
        ));

        return (new ReferenceComponent($this->app, $config))
            ->setContext($this->context)
            ->setProxyFactory($this->proxyFactory)
            ->setClientFactory($this->clientFactory)
            ->setMiddleware($middleware)
            ->refer();
    }