elbow-jason/dgraph_ex

add MutationDelete

elbow-jason opened this issue · 3 comments

add MutationDelete and delete/2 for composition of deletes

actually. MutationDelete already exists, but is non-functional. So... fix it.

this blocks #21

working as of commit 3fc657b

Examples:

  test "render mutation delete given (%Muation{}, uid, field_name, value)" do
    assert mutation()
    |> delete(uid("123"), :name, "Jason")
    |> render
    |> clean_format == clean_format("""
      mutation {
        delete {
          <123> <name> "Jason" .
        }
      }
    """)
  end

  test "render mutation delete can take wildcards" do
    assert mutation()
    |> delete("*", :name, "Jason")
    |> render
    |> clean_format == clean_format("""
      mutation {
        delete {
          * <name> "Jason" .
        }
      }
    """)
  end

  test "render mutation delete can delete all the edges" do
    assert mutation()
    |> delete("*", "*", "*")
    |> render
    |> clean_format == clean_format("""
      mutation {
        delete {
          * * * .
        }
      }
    """)
  end