lib/graphql/schema/object.rb in graphql-1.8.0.pre6 vs lib/graphql/schema/object.rb in graphql-1.8.0.pre7
- old
+ new
@@ -1,16 +1,21 @@
# frozen_string_literal: true
module GraphQL
class Schema
class Object < GraphQL::Schema::Member
+ # @return [Object] the application object this type is wrapping
attr_reader :object
+ # @return [GraphQL::Query::Context] the context instance for this query
+ attr_reader :context
+
def initialize(object, context)
@object = object
@context = context
end
+
extend GraphQL::Schema::Member::HasFields
field_class GraphQL::Schema::Field
class << self
def implements(*new_interfaces)
@@ -53,13 +58,9 @@
end
obj_type.metadata[:object_class] = self
obj_type
- end
-
- def global_id_field(field_name)
- field field_name, "ID", null: false, resolve: GraphQL::Relay::GlobalIdResolve.new(type: self)
end
end
end
end
end