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
and I want to be able to input {:request ... :response ...}, {:status ... :headers ... :body ...}, or {:b {:c 2}}, and get back {:c 2} with a query like (p.eql ... ... ... [:c]) for each of those cases.
One way would be to write this, but it's a lot of boilerplate
Is there a built-in way to do that without writing a resolver for each step ([:response] -> [:body], [:body -> [:b], [:b] -> [:c]), or would I have to write a custom function that takes a schema and figures out the resolvers to generate to effectively flatten the structure? In my case, each key in the hierarchy is unique, so there's no risk of ambiguity.
Or is this just an ill-advised thing to try and do?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Here's the problem I'm running into:
I have something that looks like
{:request {...} :response { :status ... :headers :body {:a 1 :b {:c 2}}}}and I want to be able to input
{:request ... :response ...},{:status ... :headers ... :body ...}, or{:b {:c 2}}, and get back{:c 2}with a query like(p.eql ... ... ... [:c])for each of those cases.One way would be to write this, but it's a lot of boilerplate
Is there a built-in way to do that without writing a resolver for each step (
[:response] -> [:body],[:body -> [:b],[:b] -> [:c]), or would I have to write a custom function that takes a schema and figures out the resolvers to generate to effectively flatten the structure? In my case, each key in the hierarchy is unique, so there's no risk of ambiguity.Or is this just an ill-advised thing to try and do?
Beta Was this translation helpful? Give feedback.
All reactions