module GraphQL::Rails
Constants
- NodeIdentification
Implements globally-unique object IDs for Relay compatibility.
- VERSION
Public Class Methods
Public Instance Methods
config()
click to toggle source
Configuration for this gem.
# File lib/graphql/rails/config.rb, line 11 def config @config ||= OpenStruct.new({ # Should graphql-ruby be placed into debug mode? :debug => ::Rails.env.development?, # Should the GraphiQL web interface be served? :graphiql => ::Rails.env.development?, # Should names be converted to lowerCamelCase per GraphQL convention? # For example, should :get_user_tasks become 'getUserTasks'? :camel_case => true, # Should object IDs be globally unique? # This is necessary to conform to the Relay Global Object ID spec. :global_ids => true, # Maximum nesting for GraphQL queries. # Specify nil for unlimited nesting depth. :max_depth => 8, # Should the following extensions be loaded? :mongoid => defined?(::Mongoid), :cancan => defined?(::CanCan), }) end
configure() { |config| ... }
click to toggle source
Yields the configuration object to a block, per convention.
# File lib/graphql/rails/config.rb, line 6 def configure yield config end
current_ability()
click to toggle source
# File lib/graphql/rails/extensions/cancan.rb, line 36 def current_ability @current_ability ||= ::Ability.new(current_user) end
current_user()
click to toggle source
# File lib/graphql/rails/extensions/cancan.rb, line 40 def current_user context[:current_user] end