-
Notifications
You must be signed in to change notification settings - Fork 0
Conversation
Probably could also expand on this to accept a github org and a github username as well |
need to update this to create a single mutation endpoint that can take all the params, or just a single one. per converstation with @hpjaj |
…user-can-submit-access-token
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.
Coming along nicely, @RobAWilkinson 👍
argument :githubUsername, String, required: false | ||
argument :organizationId, Int, required: false | ||
field :user, Types::UserType, null: true | ||
field :errors, [String], null: true |
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.
returns user: User, errors: [String]
Standard patterns across our graphql endpoints, wonder if it would be possible to abstract the formatting and error handling into some sort of global middleware?
spec/graphql/mutations/users/update_user_details_mutation_spec.rb
Outdated
Show resolved
Hide resolved
class UpdateUserDetailsMutation < Mutations::BaseMutation | ||
description 'Updates a User with the access_token' | ||
null true | ||
argument :personalAccessToken, String, required: false |
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.
On the ruby side, these will actually be the snake_case
versions for these args (i.e. personal_access_token
, etc.)
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.
yup, graphql-ruby 🧙♂️ takes care of that
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.
For reference, if you snake_case
in ruby, the mutation automatically gets converted to camelCase
. As makes sense (in retrospect), just snake_case everywhere and camelCase will happen everywhere in JS
Thanks graphql-ruby 👍 !
…ballio/magnifier into user-can-submit-access-token
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.
Looking great, man. Can you also pls run this on'her for good measure:
$ rubocop -a; rubocop
spec/graphql/mutations/users/update_user_details_mutation_spec.rb
Outdated
Show resolved
Hide resolved
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.
Looks great!
Background
This allows a user to submit and save their personal access token
Issue Resolved
Issue #64
Definition of Done
Sorry about the lateness on this @hpjaj hopefully integrates well with your branch