Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add very basic mutation for updating users #3918

Merged
merged 1 commit into from
Mar 29, 2022

Conversation

jonallured
Copy link
Member

@jonallured jonallured commented Mar 29, 2022

This PR aims to support the work going on over on Forque for editing a user. Prior to this PR there wasn't a way to update a user as an admin but now you can!

mutation UpdateUserMutation($input: UpdateUserMutationInput!) {
  updateUser(input: $input) {
    clientMutationId
  }
}

{
  "input": {
    "email":"jon.allured+updated@gmail.com",
    "id":"SHHHH"
  }
}

Note that this is wired up to our regular old v1 api endpoint in Gravity for users and so that means it will inherit any access controls already in place there.

Copy link
Member

@damassi damassi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👌

Comment on lines +49 to +53
} catch (err) {
if ("body" in (err as any)) {
const e = err as GravityError
throw new Error(e.body.text ?? e.body.error ?? e.body.message)
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jonallured - curious how you landed on this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok good. find damon, copy 😄

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

haha pretty much!

@artsy-peril artsy-peril bot merged commit 7c85403 into artsy:main Mar 29, 2022
@artsy-peril artsy-peril bot mentioned this pull request Mar 29, 2022
@jonallured jonallured deleted the update-user-mutation branch April 27, 2022 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants