Closed giovanialtelino closed 4 years ago
Hi,
I understand why this would be a nice simplification, but unfortunately the signature of these event handlers is already quite complicated: [query-id query variables callback-event :as event]
You'll notice query-id
is there, which is also optional. In fact, there is yet another which is a name for the re-graph instance. All this code exists just to try to sort out the arguments: https://github.com/oliyh/re-graph/blob/master/src/re_graph/internals.cljc#L30-L72
So while this might be a nice change it is practically quite hard to implement, and therefore unlikely to be done. I also think a fixed (or at least fewer) arity is clearer and easier to remember and reminds the user that variables are there to be used, rather than manipulating the query string itself.
Was getting an error on a query that requires no map:
TypeError: s.replace is not a function
With the empty map it works fine. I would like to propose a extra check after the query modifier at ::mutate ::query and ::subscribe:
Is it a good idea?