module GraphQL::Types::Relay::NodeBehaviors

Public Class Methods

included(child_module) click to toggle source
# File lib/graphql/types/relay/node_behaviors.rb, line 7
def self.included(child_module)
  child_module.extend(DefaultRelay)
  child_module.description("An object with an ID.")
  child_module.field(:id, ID, null: false, description: "ID of the object.", resolver_method: :default_global_id)
end

Public Instance Methods

default_global_id() click to toggle source
# File lib/graphql/types/relay/node_behaviors.rb, line 13
def default_global_id
  context.schema.id_from_object(object, self, context)
end