Sha256: 9065de1a27705815290842f4184a8f17b784d0d863d40666008a8d1a6af9ee59

Contents?: true

Size: 602 Bytes

Versions: 148

Compression:

Stored size: 602 Bytes

Contents

# frozen_string_literal: true
module GraphQL
  module Relay
    # Mostly an internal concern.
    #
    # Wraps an object as a `node`, and exposes a connection-specific `cursor`.
    class Edge
      attr_reader :node, :connection
      def initialize(node, connection)
        @node = node
        @connection = connection
      end

      def cursor
        @cursor ||= connection.cursor_from_node(node)
      end

      def parent
        @parent ||= connection.parent
      end

      def inspect
        "#<GraphQL::Relay::Edge (#{parent.inspect} => #{node.inspect})>"
      end
    end
  end
end

Version data entries

148 entries across 148 versions & 2 rubygems

Version Path
graphql-1.7.8 lib/graphql/relay/edge.rb
graphql-1.8.0.pre2 lib/graphql/relay/edge.rb
graphql-1.7.7 lib/graphql/relay/edge.rb
graphql-1.8.0.pre1 lib/graphql/relay/edge.rb
graphql-1.7.6 lib/graphql/relay/edge.rb
graphql-1.7.5 lib/graphql/relay/edge.rb
graphql-1.7.4 lib/graphql/relay/edge.rb
graphql-1.7.3 lib/graphql/relay/edge.rb