Parsing JSONObject custom scalar with Apollo iOS v1


I’ve been using Apollo iOS in our project for about 3 years. But when we try to upgrade Apollo iOS to v1.0.1 there is a problem with JSON values in our GraphQL schema.

We have a custom scalar named JSONObject: The JSONObject scalar type represents JSON objects as specified by ECMA-404.

Working with Apollo iOS v0.53.0 we were able to get the query data parsed to JSONObject: [String: Any] that was defined in as Apollo Core type.

With version 1.0.1 JSONObject is now defined as [String: AnyHashable] and the same solution does not work anymore.

What would be the correct way to make this work?

I have found a bit different way to solve it but the documentation has been updated for v1.0 in the meantime and I’ll change my implementation to that.

@matijakregarGH What was your solution to this? We were able to implement the documented code for our existing JSON type, however we were not able to replace the JSONObject scalar type that came from Apollo’s <1.0.0 package.