/**
 * Implements hook_rest_relation_uri_alter().
 */
function {{ machine_name }}_rest_relation_uri_alter(&$uri, $context = []) {
  if ($context['mymodule'] == TRUE) {
    $base = \Drupal::config('serialization.settings')->get('link_domain');
    $uri = str_replace($base, 'http://mymodule.domain', $uri);
  }
}
