Sha256: dd10fa613f082db5ef720b14f4190e6e4b7ed00d8606bfcdbee905baffc8ffa2

Contents?: true

Size: 522 Bytes

Versions: 33

Compression:

Stored size: 522 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 < GraphQL::ObjectType
      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
    end
  end
end

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
graphql-1.7.2 lib/graphql/relay/edge.rb
graphql-1.7.1 lib/graphql/relay/edge.rb
graphql-1.7.0 lib/graphql/relay/edge.rb
graphql-1.6.8 lib/graphql/relay/edge.rb
graphql-1.6.7 lib/graphql/relay/edge.rb
graphql-1.6.6 lib/graphql/relay/edge.rb
graphql-1.6.5 lib/graphql/relay/edge.rb
graphql-1.6.4 lib/graphql/relay/edge.rb
graphql-1.5.15 lib/graphql/relay/edge.rb
graphql-1.6.3 lib/graphql/relay/edge.rb
graphql-1.6.2 lib/graphql/relay/edge.rb
graphql-1.6.1 lib/graphql/relay/edge.rb
graphql-1.6.0 lib/graphql/relay/edge.rb
graphql-1.5.14 lib/graphql/relay/edge.rb
graphql-1.5.13 lib/graphql/relay/edge.rb
graphql-1.5.7.1 lib/graphql/relay/edge.rb
graphql-1.5.12 lib/graphql/relay/edge.rb
graphql-1.5.11 lib/graphql/relay/edge.rb
graphql-1.5.10 lib/graphql/relay/edge.rb
graphql-1.5.9 lib/graphql/relay/edge.rb