Module: GraphqlDevise::RouteMounter

Defined in:
lib/graphql_devise/route_mounter.rb

Instance Method Summary collapse

Instance Method Details

#mount_graphql_devise_for(resource, options = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'lib/graphql_devise/route_mounter.rb', line 3

def mount_graphql_devise_for(resource, options = {})
  clean_options = ResourceLoader.new(resource, options, true).call(
    Types::QueryType,
    Types::MutationType
  )

  post clean_options.at, to: 'graphql_devise/graphql#auth'
  get  clean_options.at, to: 'graphql_devise/graphql#auth'
end