lib/graphql/schema.rb
# Get a unique identifier from this object
# @param object [Any] An application object
# @param type [GraphQL::BaseType] The current type definition
# @param ctx [GraphQL::Query::Context] the context for the current query
# @return [String] a unique identifier for `object` which clients can use to refetch it
Get a unique identifier from this object
Get a unique identifier from this object
def id_from_object(object, type, ctx)
      if @id_from_object_proc.nil?
        raise(GraphQL::RequiredImplementationMissingError, "Can't generate an ID for #{object.inspect} of type #{type}, schema's `id_from_object` must be defined")
      else
        @id_from_object_proc.call(object, type, ctx)
      end
    end
def id_from_object ( object , type , ctx ) if @id_from_object_proc . nil? raise ( GraphQL :: RequiredImplementationMissingError , "Can't generate an ID for #{object.inspect} of type #{type}, schema's `id_from_object` must be defined" ) else @id_from_object_proc . call ( object , type , ctx ) end end
Get a unique identifier from this object
Get a unique identifier from this object
a unique identifier for `object` which clients can use to refetch it
a unique identifier for ` object ` which clients can use to refetch it
String
object
An application object
An application object
type
The current type definition
The current type definition
ctx
the context for the current query
the context for the current query