Exception: GQL::Errors::UndefinedFieldType

Inherits:
GQL::Error
  • Object
show all
Defined in:
lib/gql/errors.rb

Instance Method Summary collapse

Constructor Details

#initialize(id) ⇒ UndefinedFieldType

Returns a new instance of UndefinedFieldType.



28
29
30
31
32
33
# File 'lib/gql/errors.rb', line 28

def initialize(id)
  types = GQL.field_types.keys.sort.map { |id| "`#{id}`" }
  types = types.size > 0 ? " Available types: #{types.to_sentence}." : ''

  super("The field type `#{id}` is undefined. Define it with `GQL.field_types[:#{id}] = My#{id.to_s.camelize}`.#{types}")
end