Hello community,
I want to ask regarding the body passed to REST service. For example, if we have a mutation schema like following
type Mutation {
addUser(num: Int, numPointer: Int, str: String, strPointer: String): ID
}
and we set the body like following
{
"num": {{.arguments.num}},
"numPointer": "{{.arguments.numPointer}}",
"str": "{{.arguments.str}}",
"strPointer": "{{.arguments.strPointer}}"
}
then we call the following mutation
mutation test3 ($num2:Int, $str: String, $str2: String){
addUser(numPointer:$num2, str: $str, strPointer:$str2)
}
with each variable has value, but only num
that is not declared, then we got the body like following
{"body":{ "num": , "numPointer": "2", "str": "str2", "strPointer": "str2" }
which is not a valid json. So, can we omit this num
field so that it will still be a valid json and it will be better for REST service to know that it is not inputted?
Thanks community