Fork me on GitHub
#pathom
<
2019-09-04
>
kenny23:09:54

Is there a way to have ::pc/input be parameterized based on another keyword? e.g. When :type is :a, I require :a1. When :type is :b, I require :b1.

kenny18:09:29

@U066U8JQJ Is there a way to do this?

wilkerlucio18:09:19

no, this sounds like a case for unions though

wilkerlucio18:09:29

had you checked those?

kenny19:09:52

Can you use unions for ::pc/input?

wilkerlucio20:09:45

no, that's more a thing you have to do at query level, when you have different queries depending on the branching type

wilkerlucio20:09:50

this not a resolver level concern

wilkerlucio20:09:02

whats your use case?

kenny20:09:16

Exactly what I described above 🙂

kenny20:09:13

I have a single map that requires different ::pc/inputs depending on the value of a key in the map.

wilkerlucio21:09:46

that's the implementation detail you are looking for, but what is your use case? what kind of query you need to handle?

wilkerlucio21:09:26

just to be clear, what you asked specifically, is not supported, there are some already complicated rules to ensure everything runs as is, this is not a trivial thing to change, but there are many ways to model things, so I'm tryign to get your problem so we can try to model it in a way that aligns with how the library works

kenny21:09:40

I have an entity that looks something like this

{:metric/integration            {:integration/type :integration.type/aws}
 :metric/source                 :metric.source/aws-cloudwatch
 :metric.cloudwatch/metric-name "Foo"}
We have a function called metric-query that will take that metric map and issue a query to the correct destination based on attributes defined in the map. That function will return a vector of points that I want to attach to this map under the key :metric/provider-points.

wilkerlucio22:09:26

sorry, I'm not getting it yet, can you tell me some query examples and expected results?

kenny00:09:43

I actually think I have another way of doing this.