Module: GraphQL::Define::AssignGlobalIdField

Defined in:
lib/graphql/define/assign_global_id_field.rb

Class Method Summary collapse

Class Method Details

.call(type_defn, field_name) ⇒ Object



5
6
7
8
# File 'lib/graphql/define/assign_global_id_field.rb', line 5

def self.call(type_defn, field_name)
  resolve = GraphQL::Relay::GlobalIdResolve.new(type: type_defn)
  GraphQL::Define::AssignObjectField.call(type_defn, field_name, type: GraphQL::ID_TYPE.to_non_null_type, resolve: resolve)
end