Sha256: 0e1753defb7680ffc207cbf54a1b8f9fb26c4cfe4513160e73111c75f67ff48a

Contents?: true

Size: 356 Bytes

Versions: 16

Compression:

Stored size: 356 Bytes

Contents

module GraphQL
  module Relay
    class GlobalIdResolve
      def initialize(type_name:, property:)
        @property = property
        @type_name = type_name
      end

      def call(obj, args, ctx)
        id_value = obj.public_send(@property)
        ctx.query.schema.node_identification.to_global_id(@type_name, id_value)
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
graphql-0.18.15 lib/graphql/relay/global_id_resolve.rb
graphql-0.18.14 lib/graphql/relay/global_id_resolve.rb
graphql-0.18.13 lib/graphql/relay/global_id_resolve.rb
graphql-0.18.12 lib/graphql/relay/global_id_resolve.rb
graphql-0.18.11 lib/graphql/relay/global_id_resolve.rb
graphql-0.18.10 lib/graphql/relay/global_id_resolve.rb
graphql-0.18.9 lib/graphql/relay/global_id_resolve.rb
graphql-0.18.8 lib/graphql/relay/global_id_resolve.rb
graphql-0.18.7 lib/graphql/relay/global_id_resolve.rb
graphql-0.18.6 lib/graphql/relay/global_id_resolve.rb
graphql-0.18.5 lib/graphql/relay/global_id_resolve.rb
graphql-0.18.4 lib/graphql/relay/global_id_resolve.rb
graphql-0.18.3 lib/graphql/relay/global_id_resolve.rb
graphql-0.18.2 lib/graphql/relay/global_id_resolve.rb
graphql-0.18.1 lib/graphql/relay/global_id_resolve.rb
graphql-0.18.0 lib/graphql/relay/global_id_resolve.rb