Sha256: 76aad663b3b6d02e30322352930fd68bf7ddd718bfa3ce2072cea5f464ff67ea

Contents?: true

Size: 470 Bytes

Versions: 9

Compression:

Stored size: 470 Bytes

Contents

# frozen_string_literal: true
module GraphQL
  module Relay
    class GlobalIdResolve
      def initialize(type:)
        @type = type
      end

      def call(obj, args, ctx)
        if obj.is_a?(GraphQL::Schema::Object)
          obj = obj.object
        end
        type = @type.respond_to?(:graphql_definition) ? @type.graphql_definition(silence_deprecation_warning: true) : @type
        ctx.query.schema.id_from_object(obj, type, ctx)
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
graphql-1.13.9 lib/graphql/relay/global_id_resolve.rb
graphql-1.13.8 lib/graphql/relay/global_id_resolve.rb
graphql-1.13.7 lib/graphql/relay/global_id_resolve.rb
graphql-1.13.6 lib/graphql/relay/global_id_resolve.rb
graphql-1.13.5 lib/graphql/relay/global_id_resolve.rb
graphql-1.13.4 lib/graphql/relay/global_id_resolve.rb
graphql-1.13.3 lib/graphql/relay/global_id_resolve.rb
graphql-1.13.2 lib/graphql/relay/global_id_resolve.rb
graphql-1.13.1 lib/graphql/relay/global_id_resolve.rb