Exception: GQL::Errors::UndefinedType

Inherits:
SchemaError show all
Defined in:
lib/gql/errors.rb

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ UndefinedType

Returns a new instance of UndefinedType.



24
25
26
27
28
29
# File 'lib/gql/errors.rb', line 24

def initialize(name)
  types = Schema.fields.keys.sort.map { |name| "`#{name}`" }
  types = types.size > 0 ? " Available types are #{types.to_sentence}." : ''

  super("The field type `#{name}` is not known to the schema. Define it with `GQL::Schema.fields[my_type] = MyFieldType`.#{types}")
end