JSONObject cannot represent non-object value apollo client iOS

After searching and debugging everything I couldn’t find the reason behind this issue.

Mutation:

mutation saveSearch($input: SearchInput!) {
   saveSearchResult: saveSearch(input: $input) {
    saved_search_id
 }
}

Call:

let inputData = SearchInput(paramVersion: 2,
                                parameters: "{\"state\":\"ca\",\"type\":\"global\",\"sort\":\"date_order,sort_v2\"}",
                                savedSearchName: "Test01")
GraphQL.perform(mutation: SaveSearchMutation(input: i))

Error:

Received error response:

Variable “$input” got invalid value"{“state”:“ca”,“type”:“global”,“sort”:“date_order,sort_v2”}" at “input.parameters”; Expected type “JSONObject”. JSONObject cannot represent non-object value: {“state”:“ca”,“type”:“global”,“sort”:“date_order,sort_v2”}`

Hi @nickzy9, do you have any sample code you can share to demonstrate this problem?