postgraphile

GraphQL - How retrieve id of previous mutation, during query of multiple mutations

感情迁移 提交于 2020-05-30 02:02:23
问题 i would like run multiple mutations in the same query. In the example below, i create an order and after i create a product record, concerning previously created. I must have 2 mutations. First, i insert an order. In output, i retrieve among others, idorder. Then, i insert an product. This product mutation { createOrder(input: { order: { ordername: "My order" } }) { order { idorder ordername } }, createProduct(input: { product: { quantity: 3 idrefproduct: 25 # link to refProduct idorder: XXXX

GraphQL - How retrieve id of previous mutation, during query of multiple mutations

你离开我真会死。 提交于 2020-05-30 02:00:28
问题 i would like run multiple mutations in the same query. In the example below, i create an order and after i create a product record, concerning previously created. I must have 2 mutations. First, i insert an order. In output, i retrieve among others, idorder. Then, i insert an product. This product mutation { createOrder(input: { order: { ordername: "My order" } }) { order { idorder ordername } }, createProduct(input: { product: { quantity: 3 idrefproduct: 25 # link to refProduct idorder: XXXX