Fork me on GitHub
#graphql
<
2019-09-04
>
pcj14:09:58

Is there a way to do multiple mutations so that a field in one mutation can be used in subsequent mutations? Something like this where the id from create_group is to be used in add_to_group:

mutation {
  create_group {
    id
  }
  add_to_group(id: "someId", value: 1) {
      value
  }
}
Or do I have to do two executes for this to happen?

orestis14:09:28

I don’t think the graphql spec allows this. You would have to create a mutation like “create and add to group”

souenzzo14:09:12

mutations do not compose 😞 It's not only GQL limitation. EQL Ecosystem also has this limitation

pcj16:09:27

darn 😞 2 executes it is then

myguidingstar20:09:43

@souenzzo EQL has (Dotomic style) tempid however 🙂

souenzzo23:09:51

@myguidingstar yep, it solve one problem But there is no (good/stable) implementations and it's hard to guarantee consistence in both mutations (or the behavior case one fail)