# updateEntity mutation for graphql

**URL:** <https://forum.sambapos.com/t/updateentity-mutation-for-graphql/17911>\
**Category:** V5 Request\
**Created:** [August 1, 2018, 1:16pm UTC](https://forum.sambapos.com/t/updateentity-mutation-for-graphql/17911 "2018-08-01T13:16:28Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![emre](https://forum.sambapos.com/user_avatar/forum.sambapos.com/emre/32/39073_2.png) [@emre](https://forum.sambapos.com/u/emre)\
**Post date:** [August 20, 2018, 2:25pm UTC](https://forum.sambapos.com/t/updateentity-mutation-for-graphql/17911/10 "2018-08-20T14:25:54Z")

</div>

Sorry guys I’ve just find free time to read whole topic to understand what you want.

For these functions we don’t have equivalent graphql mutations because SambaPOS actions are already available to graphql by using `notifyEvent` mutation. I was thinking there was a tutorial but seems like we don’t have any. I’ll try to show a small example. I’ll be really glad if someone prepares a tutorial for it.

Think like we have an action like this.

 ![image](https://forum.sambapos.com/uploads/default/original/3X/a/2/a2f10f5715dc19133a71c2e53e458588cf43201f.png)

… and a rule to handle this action

 ![image](https://forum.sambapos.com/uploads/default/original/3X/a/f/afe2d9d840320038d7e3baf38e9ce27aef711203.png)

I can use this GraphQL mutation to change customer’s address.

```auto
mutation{notifyEvent(
  event:"AutomationCommandExecuted",
  parameters:[
    {name:"AutomationCommandName",value:"Change Customer Address"},
    {name:"EntityName", value:"Emre Eren"},
    {name:"Address", value:"Test 1234"}
  ],
  user:"Administrator",
  ticketType:"Ticket",
  terminal:"Server",
  department:"Restaurant",
  state:{ticket:{id:0}}
){ticket{id}}}

```

This is basically how Rule Parameters are mapped.

 ![2018-08-20_17-19-32](https://forum.sambapos.com/uploads/default/original/3X/d/7/d7d1b797127bc6f0d7b2406ce64d1fe79b0270fe.png)

This is how it works.

 ![2018-08-20_17-22-25](https://forum.sambapos.com/uploads/default/original/3X/d/1/d1c4b78a663302120c21f6e5c0e3223ffd66df8b.gif)

You can execute any SambaPOS action by using this technique.

PS: `state` parameter is useful to execute ticket related actions. For non ticket actions you can just set an empty ticket as shown on the example.

---

_[View the full topic](https://forum.sambapos.com/t/updateentity-mutation-for-graphql/17911)._
