Method: GraphQL::BaseType.resolve_related_type

Defined in:
lib/graphql/base_type.rb

During schema definition, types can be defined inside procs or as strings. This function converts it to a type instance

Returns:



164
165
166
167
168
169
170
171
172
173
174
175
# File 'lib/graphql/base_type.rb', line 164

def self.resolve_related_type(type_arg)
  case type_arg
  when Proc
    # lazy-eval it
    type_arg.call
  when String
    # Get a constant by this name
    Object.const_get(type_arg)
  else
    type_arg
  end
end