forked from membrane/api-gateway
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrequests.http
More file actions
69 lines (54 loc) · 2.03 KB
/
requests.http
File metadata and controls
69 lines (54 loc) · 2.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
### Valid POST request with simple query
POST http://localhost:2000
Content-Type: application/json
{
"query": "query { products { id name price } }"
}
### Fail because an extension was added
POST http://localhost:2000
Content-Type: application/json
{
"query": "query { products { id name price } }",
"extensions": {
"persistedQuery": {
"version": 1,
"sha256Hash": "invalid"
}
}
}
### Fail because invalid method was used
PUT http://localhost:2000
Content-Type: application/json
{
"query": "query { products { id name } }"
}
### Fail because recursion is too deep
POST http://localhost:2000
Content-Type: application/json
{
"query": "query { categories { products { category { products { category { products { id } } } } } } }"
}
### Pass because recursion depth is just right
POST http://localhost:2000
Content-Type: application/json
{
"query": "query { categories { products { category { products { id } } } } }"
}
### Fail because query is nested too deeply
POST http://localhost:2000
Content-Type: application/json
{
"query": "query { categories { products { category { products { vendor { products { category { id name products { id } } } } } } } } }"
}
### Fail because we exceeded the mutation limit
POST http://localhost:2000
Content-Type: application/json
{
"query": "mutation { addProduct(name: \"Apple\", price: 1.99) { id } addProduct(name: \"Orange\", price: 2.99) { id } addProduct(name: \"Banana\", price: 3.99) { id } addProduct(name: \"Grape\", price: 4.99) { id } addProduct(name: \"Mango\", price: 5.99) { id } addProduct(name: \"Pear\", price: 6.99) { id } }"
}
### Pass because we are just on the limit of mutations
POST http://localhost:2000
Content-Type: application/json
{
"query": "mutation { addProduct1: addProduct(name: \"Apple\", price: 1.99) { id } addProduct2: addProduct(name: \"Orange\", price: 2.99) { id } addProduct3: addProduct(name: \"Banana\", price: 3.99) { id } addProduct4: addProduct(name: \"Grape\", price: 4.99) { id } addProduct5: addProduct(name: \"Mango\", price: 5.99) { id } }"
}