Class: GraphQL::Schema::IntrospectionSystem::PerFieldProxyResolve
- Inherits:
-
Object
- Object
- GraphQL::Schema::IntrospectionSystem::PerFieldProxyResolve
- Defined in:
- lib/graphql/schema/introspection_system.rb
Instance Method Summary collapse
-
#call(obj, args, ctx) ⇒ Object
-
#initialize(object_class:, inner_resolve:) ⇒ PerFieldProxyResolve
constructor
A new instance of PerFieldProxyResolve.
Constructor Details
#initialize(object_class:, inner_resolve:) ⇒ PerFieldProxyResolve
Returns a new instance of PerFieldProxyResolve
81 82 83 84 |
# File 'lib/graphql/schema/introspection_system.rb', line 81 def initialize(object_class:, inner_resolve:) @object_class = object_class @inner_resolve = inner_resolve end |
Instance Method Details
#call(obj, args, ctx) ⇒ Object
86 87 88 89 90 91 92 93 94 |
# File 'lib/graphql/schema/introspection_system.rb', line 86 def call(obj, args, ctx) query_ctx = ctx.query.context # Remove the QueryType wrapper if obj.is_a?(GraphQL::Schema::Object) obj = obj.object end wrapped_object = @object_class.(obj, query_ctx) @inner_resolve.call(wrapped_object, args, ctx) end |