-
Notifications
You must be signed in to change notification settings - Fork 221
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Map scalar type #91
Comments
I can feel your pain. In fact, I have similar situation with our API, I guess I add a comment on your issue as well. There is also similar issue in graphql-js repo: graphql/graphql-js#207. I think it should be possible to implement Also In general, I would prefer to stick to the spec in this respect and not introduce any custom sangria-specific mechanisms or concepts. On the other hand, I do would like to push input interfaces and input union types as well, so I would suggest to push it together into the spec :) |
Thanks for the feedback. I'll see what I can do. |
Hi there,
I'm trying to model something and I might be at the edge of graphql itself. Here is the thing: I have an abstract type
Customization
and many (dozens) concrete subtypes, each one with its own attributes. This list of subtypes will grow over time.This is okay to model on the query side, an Customization Interface and many object types, one per subtype, the problem is the mutation side, since input types cannot be abstract (
addCustomizationToNode(nodeId, customizationInput)
), I have to define one mutation per concrete subtype (addSubtypeAToNode
,addSubtypeBToNode
) etc.I opened an issue on graphql but I don't anticipate this being implemented soon or at all. In the mean time I need to solve this problem so I'm trying to implement a MapType that models an Map[String, Any] so I can use it as the input param, escape the type system and check the input attributes at runtime myself.
This is what I got so far:
The problem is that I'd be repeating all the value cases for String, Int, yada yada and I was wondering if I could relay on sangria to do that, since it is already implemented, but I couldn't find it.
Any ideas, suggestions? Thank you!
The text was updated successfully, but these errors were encountered: