Take custom mutations when mounting gem in routes#5
Merged
mcelicalderon merged 3 commits intomasterfrom Aug 30, 2019
Merged
Conversation
2d96400 to
8716767
Compare
8716767 to
521fc1d
Compare
00dav00
approved these changes
Aug 30, 2019
| argument :email, String, required: true | ||
| argument :password, String, required: true | ||
|
|
||
| field :authenticable, GraphqlDevise::Types::AuthenticableType, null: true |
|
|
||
| yield current_resource if block_given? | ||
|
|
||
| { success: true, errors: [], authenticable: current_resource } |
Contributor
There was a problem hiding this comment.
Should authenticable be among the response fields?
|
|
||
| gemspec | ||
|
|
||
| gem 'listen' |
| skip: [:sessions, :registrations, :passwords, :confirmations, :omniauth_callbacks, :unlocks] | ||
| ) | ||
|
|
||
| authenticable_type = opts[:authenticable_type] || |
Contributor
There was a problem hiding this comment.
What about this kind indentation, I find it clearer:
authenticable_type =
opts[:authenticable_type] ||
GraphqlDevise::Util::ClassGetter.call("Types::#{resource}Type") ||
GraphqlDevise::Types::AuthenticableType| }.freeze | ||
|
|
||
| default_mutations.each do |action, mutation| | ||
| used_mutation = if mutation_options[action].present? |
Contributor
There was a problem hiding this comment.
What about this style for indentation?
used_mutation =
if mutation_options[action].present?
...
else
...
end| @@ -0,0 +1,11 @@ | |||
| module GraphqlDevise | |||
| module Util | |||
| module ClassGetter | |||
Contributor
There was a problem hiding this comment.
I think this class is very similar to safe_constantize. WDYT about using this instead?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.