def METHOD_NAME(endpoint=None, metadata_path=None, verbose=True):
    if endpoint is None:
        endpoint = f"http://{config.hasura.host}:{config.hasura.port}"
    if metadata_path is None:
        metadata_path = HASURA_DIR / "migrations" / "metadata.yaml"
    endpoint = os.path.join(endpoint, "v1", "query")
    with open(metadata_path, "r") as f:
        metadata = yaml.load(f, Loader=yaml.SafeLoader)
    response = requests.post(
        endpoint,
        json={"type": "replace_metadata", "args": {"metadata": metadata}},
    )
    try:
        response.raise_for_status()
        if verbose:
            click.secho(f"Applied Hasura metadata from {metadata_path}")
    except Exception as exc:
        # echo the error
        click.secho(
            f"\nError applying Hasura metadata from {metadata_path}",
            fg="red",
            bold=True,
        )
        raise click.ClickException(f"Failed to apply Hasura metadata! Error: {exc}")