Closed brandonmp closed 7 years ago
spoke w/ vince abt this in slack, just posting here so details aren't lost in slack chat flow
trying to update the viewer.user & fetch new data from payload.viewer.user
viewer.user
payload.viewer.user
Here's code. Assume viewer.user.id === 'abc' and viewer.user.firstName === 'Brandon'
viewer.user.id === 'abc'
viewer.user.firstName === 'Brandon'
// mutation to change firstName from "Brandon" to "Bort" mutation UpdateUser($input: UpdateUserInput!) { updateUser(input:$input) { changedUser { id firstName } viewer { user { id firstName } } } } { "input": { "id": "abc", "firstName": "Bort" } }
// response { "data": { "updateUser": { "changedUser": { "id": "abc", "firstName": "Bort" }, "viewer": { "user": { "id": "abc", "firstName": "Brandon" } } } } }
as you can see the response has different values in viewer and changedUser, but the id field is the same, so it's def. 2 diff't values for same record.
viewer
changedUser
id
Should be fixed. Messaged you on Slack. Make sure you're not resetting the headers.
spoke w/ vince abt this in slack, just posting here so details aren't lost in slack chat flow
trying to update the
viewer.user
& fetch new data frompayload.viewer.user
Here's code. Assume
viewer.user.id === 'abc'
andviewer.user.firstName === 'Brandon'
as you can see the response has different values in
viewer
andchangedUser
, but theid
field is the same, so it's def. 2 diff't values for same record.