paren-com / serene

Generate clojure.spec with GraphQL and extend GraphQL with clojure.spec
135 stars 3 forks source link

Lacinia turns enum values into keywords; Serene expects strings #6

Closed solussd closed 5 years ago

solussd commented 5 years ago

Would it be possible to control this in serene?

solussd commented 5 years ago

I hacked around this using the transducer multimethod, but it would be nice to be able to configure the enum behavior (e.g., whether or not to generate specs for each enum value, coercing to other types, etc.).

domkm commented 5 years ago

I'm open to something like this but I would prefer a more generic solution that allows customization of other scalars as well. I'm hesitant to address this currently because spec2 will be more capable of reifying context, which is very relevant for GraphQL. For example, an enum might be a string as serialized input, a keyword as parsed input, and a string as both serialized and parsed output (depending on the client). See https://github.com/paren-com/serene/issues/3#issuecomment-446726625 for more info.