graphql

pcj 2019-09-04T14:34:58.015Z

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?

orestis 2019-09-04T14:50:28.016200Z

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

souenzzo 2019-09-04T14:53:12.017100Z

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

pcj 2019-09-04T16:01:27.017800Z

darn 😞 2 executes it is then

2019-09-04T20:57:43.018700Z

@souenzzo EQL has (Dotomic style) tempid however 🙂

souenzzo 2019-09-04T23:12:51.019800Z

@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)