-
Notifications
You must be signed in to change notification settings - Fork 90
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👌
} 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) | ||
} |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LOL I just ripped off @dzucconi on this one:
https://github.com/artsy/metaphysics/blob/main/src/schema/v2/me/updateMyPasswordMutation.ts#L45-L66
There was a problem hiding this comment.
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 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
haha pretty much!
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!
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.