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