iOS Swift CodeGen scalars conflicting with Foundation types


I’m trying to port our project from 0.x to the 1.0 SDK. In the process of switching over to the new CodeGen tool, I am running into a problem of conflicting types and I am not clear on how to best resolve this problem.

Here’s a simple example:

scalar Date
scalar URL

type Sample {
  date: Date
  url: URL

Once you run the codegen tool, you end up with a Custom Scalars folder with type aliases for both URL and Date of type String, but that conflicts with Foundation’s types. Trying to then resolve all these conflicts becomes a huge headache.

Am I missing something? Is there a way to work around this problem? Thanks!

Having the exact same issue, whenever I have a Date() initializer I’m getting “ambiguous use of” errors because it’s not sure if I’m referring to the generated scalar type or the Foundation type. Of course most of the times it’s the Foundation type, but prefixing it with Foundation. is just a huge headache and inconvenient. It would be good to have some possibility to map custom scalar names when generating code