Sha256: ff841414f759386c34e46248e1ab6ed5afe9170c6bb2d2635196e5bc38f77ded

Contents?: true

Size: 577 Bytes

Versions: 10

Compression:

Stored size: 577 Bytes

Contents

# frozen_string_literal: true
module GraphQL
  class Schema
    class Field
      # This object is backed by an `Object`, but the resolve isn't expecting
      # that wrapper, so unwrap it before calling the inner resolver
      class UnwrappedResolve
        def initialize(inner_resolve:)
          @inner_resolve = inner_resolve
        end

        def call(obj, args, ctx)
          # Might be nil, still want to call the func in that case
          inner_obj = obj && obj.object
          @inner_resolve.call(inner_obj, args, ctx)
        end
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
graphql-1.8.0.pre10 lib/graphql/schema/field/unwrapped_resolve.rb
graphql-1.8.0.pre9 lib/graphql/schema/field/unwrapped_resolve.rb
graphql-1.8.0.pre8 lib/graphql/schema/field/unwrapped_resolve.rb
graphql-1.8.0.pre7 lib/graphql/schema/field/unwrapped_resolve.rb
graphql-1.8.0.pre6 lib/graphql/schema/field/unwrapped_resolve.rb
graphql-1.8.0.pre5 lib/graphql/schema/field/unwrapped_resolve.rb
graphql-1.8.0.pre4 lib/graphql/schema/field/unwrapped_resolve.rb
graphql-1.8.0.pre3 lib/graphql/schema/field/unwrapped_resolve.rb
graphql-1.8.0.pre2 lib/graphql/schema/field/unwrapped_resolve.rb
graphql-1.8.0.pre1 lib/graphql/schema/field/unwrapped_resolve.rb