I have the following JSON scalar:

"""
The `JSON` scalar type represents JSON values as specified by [ECMA-404](http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf).
"""
scalar JSON

which I am trying to convert since my query is accepting input: JSON. When testing using graphql playground, query is JSON object thus the following works:

query {
  carts(where: {
    owner:{id: "xxx"}
    store:{name: "yyy"}
  }) {
    id
  }
}
# query is the starting from the where: {...}

However when using ferry, I have trouble converting the scalar JSON, I've tried to convert it to String and/or Map<String, dynamic> but both are throwing errors. I am trying to write my custom serializer following this link: https://ferrygraphql.com/docs/custom-scalars/ however it is throwing the same error like when I'm trying converting it to Map<String, dynamic>, I have no idea what to convert to as dart do not have any type of JsonObject and usually Map is suffice for json representation. Any idea guys? I'd appreciate any clues as I've exhausted all of my options and am currently bruteforce trying