lib/graphql/schema/object.rb in graphql-1.11.10 vs lib/graphql/schema/object.rb in graphql-1.12.0
- old
+ new
@@ -12,9 +12,20 @@
attr_reader :object
# @return [GraphQL::Query::Context] the context instance for this query
attr_reader :context
+ # @return [GraphQL::Dataloader]
+ def dataloader
+ context.dataloader
+ end
+
+ # Call this in a field method to return a value that should be returned to the client
+ # without any further handling by GraphQL.
+ def raw_value(obj)
+ GraphQL::Execution::Interpreter::RawValue.new(obj)
+ end
+
class << self
# This is protected so that we can be sure callers use the public method, {.authorized_new}
# @see authorized_new to make instances
protected :new