You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the relay-playground, the mutation only accepts primitive types as arguments. I'm trying to have a mutation parameter which is an object. The issue is that in mutateAndGetPayload, the input object is a Map and the input object comes through as a nested Map rather than the correct type. I'm currently handling this using:
val myObj = fromMap[MyInputType](input("myObj").asInstanceOf[Map[String, Any]])
In the relay-playground, the mutation only accepts primitive types as arguments. I'm trying to have a mutation parameter which is an object. The issue is that in mutateAndGetPayload, the input object is a Map and the input object comes through as a nested Map rather than the correct type. I'm currently handling this using:
where "fromMap" is a function that instantiates a case class from a Map that I got from https://stackoverflow.com/questions/20684572/scala-convert-map-to-case-class.
This works in my current case but feels wrong and I think will break down if I get to nested objects.
In there a correct pattern for this.
The text was updated successfully, but these errors were encountered: