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.13.23 lib/graphql/relay/edge.rb
graphql-1.13.22 lib/graphql/relay/edge.rb
graphql-1.13.21 lib/graphql/relay/edge.rb
graphql-1.13.20 lib/graphql/relay/edge.rb
graphql-1.13.19 lib/graphql/relay/edge.rb
graphql-1.13.18 lib/graphql/relay/edge.rb
graphql-1.13.17 lib/graphql/relay/edge.rb
graphql-1.13.16 lib/graphql/relay/edge.rb
graphql-1.13.15 lib/graphql/relay/edge.rb
graphql-1.13.14 lib/graphql/relay/edge.rb
graphql-1.13.13 lib/graphql/relay/edge.rb
graphql_cody-1.13.0 lib/graphql/relay/edge.rb
graphql-1.13.12 lib/graphql/relay/edge.rb
graphql-1.13.11 lib/graphql/relay/edge.rb
graphql-1.13.10 lib/graphql/relay/edge.rb
graphql-1.13.9 lib/graphql/relay/edge.rb
graphql-1.12.24 lib/graphql/relay/edge.rb
graphql-1.13.8 lib/graphql/relay/edge.rb
graphql-1.13.7 lib/graphql/relay/edge.rb
graphql-1.13.6 lib/graphql/relay/edge.rb