@@ -13,7 +13,7 @@ type Root {
13
13
14
14
"""
15
15
Since we used `application/x-www-form-urlencoded` as a value for our `Content-Type` header, StepZen will
16
- encode the postbody as form-encoded and the httpbingo.org/post will return
16
+ encode the postbody as form-encoded and the httpbingo.org/post will return
17
17
it in form. You'll see that `args` and `data` will be empty, and `json` will be null, when you run the following query.
18
18
query MyQuery {
19
19
restquery(name: "Joe Smith", city: "New York") {
@@ -26,21 +26,22 @@ query MyQuery {
26
26
}
27
27
"""
28
28
type Query {
29
- restquery (name :String , city : String ): Root
29
+ restquery (name : String , city : String ): Root
30
30
# Set a JSON query return type to avoid any type conflicts that you might have during testing.
31
31
# You cannot subselect fields this way.
32
32
# restquery(name:String, city: String): JSON
33
- @rest (endpoint : " https://httpbingo.org/post" ,
34
- method : POST ,
35
- headers : [{name : " Accept" , value :"application/json" },
36
- {name : " Content-Type" , value : " application/x-www-form-urlencoded" }],
37
-
33
+ @rest (
34
+ endpoint : " https://httpbingo.org/post"
35
+ method : POST
36
+ headers : [
37
+ { name : " Accept" , value : " application/json" }
38
+ { name : " Content-Type" , value : " application/x-www-form-urlencoded" }
39
+ ]
38
40
)
39
41
}
40
42
41
-
42
43
"""
43
- When the 'Accept' header is `application/json`, StepZen will automatically populate the body.
44
+ When the 'Accept' header is `application/json`, StepZen will automatically populate the body.
44
45
Note: if method POST is used, The default for `Content-Type` is `application/json`.
45
46
46
47
Using the sample GraphQL query, data will show the contents of the postbody and json as transformed to JSON.
@@ -57,14 +58,14 @@ query MyQuery {
57
58
}
58
59
}
59
60
"""
60
-
61
61
type Query {
62
- restjsonbodyquery (name :String , city : String ): Root
62
+ restjsonbodyquery (name : String , city : String ): Root
63
63
# Set a JSON query return type to avoid any type conflicts that you might have during testing.
64
64
# You cannot subselect fields this way.
65
65
# restjsonbodyquery(name:String, city: String): JSON
66
- @rest (endpoint : " https://httpbingo.org/post" ,
67
- method : POST ,
68
- headers : [{name : " Accept" , value :"application/json" }]
66
+ @rest (
67
+ endpoint : " https://httpbingo.org/post"
68
+ method : POST
69
+ headers : [{ name : " Accept" , value : " application/json" }]
69
70
)
70
- }
71
+ }
0 commit comments