Fork me on GitHub

Is there documentation on how to specify a mutation that requires particular input/s? My use case is a mutation that needs to know the current user (which is available via an output only current-user-resolver).


@cjmurphy I just do (let [user-data (parser env [...])]) inside mutation But I think that you can do something with pc/transform too


Also I'm trying to develop a "style guide" to help us to know/remember/develop that kind of "pattern" in EQL ecosystem :)


Re. your style guide there is a comment that doesn't seem to apply to the code below it.


I called the parser again, but from a function so can explicitly see all the cases. As it happens the current user is in the env so I could have just grabbed directly.


What would make sense to me would be if inputs were 'first class citizens' for mutations, which I think can be done with a plugin. And I was just wondering if it had been documented. Possibly that's the pc/transform you mentioned. For me is seems nice to only use standard plugins.


Currently every mutation has 2 args, first being env and second being params. If inputs were first class citizens then there would be 3 args, with the extra one being inputs. I guess it is some kind of a plugin that would provide that. Not sure your code is that generic. I know @U066U8JQJ was experimenting with something that did that. Not sure if it was finished or documented.


@cjmurphy they are different concerns, params are for mutations what input is for resolvers, but they are different in the sense that params are sent as-is, you can make a plugin to auto-resolve the params on mutations, the arity 3 could be a thing, but not sure at this moment

Eric Ihli18:07:13

I see this mutation in an example. Does pathom guarantee mutations are run in order? Does it depend on configuration ( [(log-in ~credentials) (finish-log-in {})])


@ericihli [(op-1 {}) (op-2 {})] ~> both MAY be executed at same time (parallel parser will, serial parser don't [{(op-1 {}) [(op-2 {})]}] -> op-2 will only start after op-1 finish. But in general, isn't a good idea compose mutations in EQL Prefer [(log-in+finish-log-in ~creds)]

🙏 3