graphql

kwrooijen 2020-06-12T08:32:47.181400Z

I'm wondering if there's a way to convert the map automatically to simple-keywords, since returning qualified-keywords doesn't seem like an option

2020-06-12T10:41:42.181600Z

Maybe this is what you are looking for: https://lacinia.readthedocs.io/en/latest/resolve/attach.html#resolver-factories

2020-06-12T10:42:57.181800Z

Bit hazy on the details tho

kwrooijen 2020-06-12T12:28:51.182Z

Thanks, I'll take a look at that

defa 2020-06-12T14:24:31.182200Z

Just an idea, haven’t tried that… when you create lacinia’s GraphQL schema, you attach you resolvers. There you could wrap all resolvers with a function that will handle the mapping. Here you have endless possibilities like, stripping the namespace part of all map keys that are keywords or use a map where you define these mappings (e.g. {:person/id :person :person/name :name})

defa 2020-06-12T14:26:24.182500Z

… or use GraphQL directives to specify this mapping in the schema. I did something like that for checking authorisation. If you are interested in details, I can put something together…

defa 2020-06-12T14:27:28.182700Z

are you using lacinia-pedestal? You might also put that into an interceptor.

defa 2020-06-12T14:32:46.182900Z

If GraphQL compatibility is not an issue you might look at https://github.com/wilkerlucio/pathom which gives you the full potential of EDN an thus namespaced keys.