Skip to main content

Stack

Is very similar to Sync. Only with one difference. It will not delete anything.

Now lets try again and add groups that were previously dissociated from john.

Mutation#

mutation ($user: UserInput) {  stackUser(user: $user) {    name    roles {      name    }    groups {      name    }  }}

Variables#

{  "user": {    "name": "john_wayne",    "groups": [      {        "name": "Legends"      },      {        "name": "Oldschool"      }    ],    "roles": [      {        "name": "Smokers"      }    ]  }}

Response#

{  "data": {    "stackUser": {      "name": "john_wayne",      "roles": [        {          "name": "Bad Boys"        },        {          "name": "Smokers"        }      ],      "groups": [        {          "name": "Sharks"        },        {          "name": "Legends"        },        {          "name": "Oldschool"        }      ]    }  }}

Great, it didn't delete anything. Mutation added Legends, and Oldschool groups and Smokers role to john_wayne user.