public function makeFromResource(ResourceInterface $resource, $transformer = null, string $resourceKey = null): ResourceInterface
    {
        $transformer = $this->resolveTransformer($resource->getData(), $transformer ?: $resource->getTransformer());
        $resourceKey = $this->resolveResourceKey($resource->getData(), $resourceKey ?: $resource->getResourceKey());

        return $resource->setTransformer($transformer)->setResourceKey($resourceKey);
    }