github.com/speedoops/go-gqlrest-demo@v0.0.0-20220710122636-5c6460aeab4f/graphql_test.http (about)

     1  ### TODO 样例
     2  POST http://localhost:8080/query HTTP/1.1
     3  content-type: application/json
     4  X-Request-Type: GraphQL
     5  
     6  mutation createTodo {
     7    createTodo(input: {userID:"uid", text:"text"}){
     8      id,text,done
     9    }
    10  }
    11  
    12  ### TODO 样例
    13  POST http://localhost:8080/query HTTP/1.1
    14  content-type: application/json
    15  X-Request-Type: GraphQL
    16  
    17  mutation updateTodo($id: ID!) {
    18    updateTodo(input: {id:$id, userID:"uid", text:"9527.Updated"}){
    19      id,text,done
    20    }
    21  }
    22  
    23  {
    24    "id": "T9527",
    25    "id2": "T9527"
    26  }
    27  
    28  
    29  ### TODO 样例
    30  POST http://localhost:8080/query HTTP/1.1
    31  content-type: application/json
    32  X-Request-Type: GraphQL
    33  
    34  query todos {
    35    todos(ids:["T9527"],userId2:"userID2",text2:"text2",done2:true) {
    36      id
    37      text
    38      done
    39    }
    40  }
    41  
    42  ### TODO 样例
    43  POST http://localhost:8080/query HTTP/1.1
    44  content-type: application/json
    45  X-Request-Type: GraphQL
    46  
    47  mutation deleteTodo {
    48    deleteTodoByUser(userID:"uid")
    49  }
    50  
    51  ### TODO 样例
    52  POST http://localhost:8080/graphql HTTP/1.1
    53  content-type: application/json
    54  X-Request-Type: GraphQL
    55  
    56  query todos {
    57    todos {
    58      id
    59      text
    60      done
    61    }
    62  }
    63  
    64  ###
    65  POST http://localhost:8080/graphql HTTP/1.1
    66  content-type: application/json
    67  X-Request-Type: GraphQL
    68  
    69  query queryByName($name: String!) {
    70    vms(names:[$name]) {
    71      id
    72      name
    73    }
    74  }
    75  
    76  {
    77    "name": "test"
    78  }
    79  
    80  
    81  ###
    82  POST http://localhost:8080/graphql HTTP/1.1
    83  content-type: application/json
    84  X-Request-Type: GraphQL
    85  
    86  query overlapping {
    87    overlapping {
    88      oneFoo
    89      twoFoo
    90      oldFoo
    91      newFoo
    92    }
    93  }