Sha256: 5dc25c8744ea393ab2a689743b07c2bb6de2b243e04c5d36b580ecb4bc692711

Contents?: true

Size: 856 Bytes

Versions: 11

Compression:

Stored size: 856 Bytes

Contents

module GraphQL
  module Relay
    module Define
      module AssignConnection
        def self.call(type_defn, name, type = nil, desc = nil, property: nil, max_page_size: nil, &block)
          underlying_field = GraphQL::Define::AssignObjectField.call(type_defn, name, type, desc, property: property, &block)
          connection_field = GraphQL::Relay::ConnectionField.create(underlying_field, max_page_size: max_page_size)
          type_defn.fields[name.to_s] = connection_field
        end
      end

      module AssignGlobalIdField
        def self.call(type_defn, field_name)
          type_defn.name || raise("You must define the type's name before creating a GlobalIdField")
          GraphQL::Define::AssignObjectField.call(type_defn, field_name, field: GraphQL::Relay::GlobalIdField.new(type_defn.name))
        end
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
graphql-relay-0.11.2 lib/graphql/relay/define.rb
graphql-relay-0.11.1 lib/graphql/relay/define.rb
graphql-relay-0.11.0 lib/graphql/relay/define.rb
graphql-relay-0.10.0 lib/graphql/relay/define.rb
graphql-relay-0.9.5 lib/graphql/relay/define.rb
graphql-relay-0.9.4 lib/graphql/relay/define.rb
graphql-relay-0.9.2 lib/graphql/relay/define.rb
graphql-relay-0.9.1 lib/graphql/relay/define.rb
graphql-relay-0.9.0 lib/graphql/relay/define.rb
graphql-relay-0.8.1 lib/graphql/relay/define.rb
graphql-relay-0.8.0 lib/graphql/relay/define.rb