github.com/dgraph-io/dgraph@v1.2.8/graphql/resolve/delete_mutation_test.yaml (about)

     1  -
     2    name: "Only id filter"
     3    gqlmutation: |
     4      mutation deleteAuthor($filter: AuthorFilter!) {
     5        deleteAuthor(filter: $filter) {
     6          msg
     7        }
     8      }
     9    gqlvariables: |
    10      { "filter":
    11        { "id": ["0x1", "0x2"] }
    12      }
    13    explanation: "The correct mutation and query should be built using variable and filters."
    14    dgmutations:
    15      - deletejson: |
    16          { "uid": "uid(x)" }
    17    dgquery: |-
    18      query {
    19        x as deleteAuthor(func: uid(0x1, 0x2)) @filter(type(Author)) {
    20          uid
    21        }
    22      }
    23  
    24  -
    25    name: "Multiple filters including id"
    26    gqlmutation: |
    27      mutation deleteAuthor($filter: AuthorFilter!) {
    28        deleteAuthor(filter: $filter) {
    29          msg
    30        }
    31      }
    32    gqlvariables: |
    33      { "filter":
    34        {
    35          "id": ["0x1", "0x2"],
    36          "name": { "eq": "A.N. Author" }
    37        }
    38      }
    39    explanation: "The correct mutation and query should be built using variable and filters."
    40    dgmutations:
    41      - deletejson: |
    42          { "uid": "uid(x)" }
    43    dgquery: |-
    44      query {
    45        x as deleteAuthor(func: uid(0x1, 0x2)) @filter((eq(Author.name, "A.N. Author") AND type(Author))) {
    46          uid
    47        }
    48      }
    49  
    50  -
    51    name: "Multiple non-id filters"
    52    gqlmutation: |
    53      mutation deleteAuthor($filter: AuthorFilter!) {
    54        deleteAuthor(filter: $filter) {
    55          msg
    56        }
    57      }
    58    gqlvariables: |
    59      { "filter":
    60        {
    61          "name": { "eq": "A.N. Author" },
    62          "dob": { "eq": "2000-01-01" }
    63        }
    64      }
    65    explanation: "The correct mutation and query should be built using variable and filters."
    66    dgmutations:
    67      - deletejson: |
    68          { "uid": "uid(x)" }
    69    dgquery: |-
    70      query {
    71        x as deleteAuthor(func: type(Author)) @filter((eq(Author.dob, "2000-01-01") AND eq(Author.name, "A.N. Author"))) {
    72          uid
    73        }
    74      }