Sha256: 90304a27b0869477d34a74aa3e3d976ee9086cbf8e82d98bbbaf8276d8ec9ee4

Contents?: true

Size: 637 Bytes

Versions: 44

Compression:

Stored size: 637 Bytes

Contents

# frozen_string_literal: true
module GraphQL
  module Relay
    module EdgeType
      def self.create_type(wrapped_type, name: nil, &block)
        GraphQL::ObjectType.define do
          type_name = wrapped_type.is_a?(GraphQL::BaseType) ? wrapped_type.name : wrapped_type.graphql_name
          name("#{type_name}Edge")
          description "An edge in a connection."
          field :node, wrapped_type, "The item at the end of the edge."
          field :cursor, !types.String, "A cursor for use in pagination."
          relay_node_type(wrapped_type)
          block && instance_eval(&block)
        end
      end
    end
  end
end

Version data entries

44 entries across 44 versions & 1 rubygems

Version Path
graphql-1.8.18 lib/graphql/relay/edge_type.rb
graphql-1.9.21 lib/graphql/relay/edge_type.rb
graphql-1.9.20 lib/graphql/relay/edge_type.rb
graphql-1.9.19 lib/graphql/relay/edge_type.rb
graphql-1.9.18 lib/graphql/relay/edge_type.rb
graphql-1.10.0.pre3 lib/graphql/relay/edge_type.rb
graphql-1.9.17 lib/graphql/relay/edge_type.rb
graphql-1.10.0.pre2 lib/graphql/relay/edge_type.rb
graphql-1.9.16 lib/graphql/relay/edge_type.rb
graphql-1.9.15 lib/graphql/relay/edge_type.rb
graphql-1.9.14 lib/graphql/relay/edge_type.rb
graphql-1.10.0.pre1 lib/graphql/relay/edge_type.rb
graphql-1.9.13 lib/graphql/relay/edge_type.rb
graphql-1.9.12 lib/graphql/relay/edge_type.rb
graphql-1.9.11 lib/graphql/relay/edge_type.rb
graphql-1.9.10 lib/graphql/relay/edge_type.rb
graphql-1.9.9 lib/graphql/relay/edge_type.rb
graphql-1.9.8 lib/graphql/relay/edge_type.rb
graphql-1.9.7 lib/graphql/relay/edge_type.rb
graphql-1.9.6 lib/graphql/relay/edge_type.rb