@@ -4,7 +4,7 @@ def mount_graphql_devise_for(resource, opts = {})
44 custom_operations = opts [ :operations ] || { }
55
66 path = opts . fetch ( :at , '/' )
7- mapping_name = resource . underscore . tr ( '/' , '_' )
7+ mapping_name = resource . underscore . tr ( '/' , '_' ) . to_sym
88
99 devise_for (
1010 resource . pluralize . underscore . tr ( '/' , '_' ) . to_sym ,
@@ -34,6 +34,7 @@ def mount_graphql_devise_for(resource, opts = {})
3434
3535 new_mutation
3636 end
37+ used_mutation . instance_variable_set ( :@resource_name , mapping_name )
3738
3839 GraphqlDevise ::Types ::MutationType . field ( "#{ mapping_name } _#{ action } " , mutation : used_mutation )
3940 end
@@ -53,13 +54,14 @@ def mount_graphql_devise_for(resource, opts = {})
5354
5455 new_query
5556 end
57+ used_query . instance_variable_set ( :@resource_name , mapping_name )
5658
5759 GraphqlDevise ::Types ::QueryType . field ( "#{ mapping_name } _#{ action } " , resolver : used_query )
5860 end
5961
6062 Devise . mailer . helper ( GraphqlDevise ::MailerHelper )
6163
62- devise_scope mapping_name . to_sym do
64+ devise_scope mapping_name do
6365 post "#{ path } /graphql_auth" , to : 'graphql_devise/graphql#auth'
6466 get "#{ path } /graphql_auth" , to : 'graphql_devise/graphql#auth'
6567 end
0 commit comments