graphiti-rails
graphiti-rails copied to clipboard
Attribute text not support in generator
trafficstars
Schema Information for model Post:
# == Schema Information
#
# Table name: posts
#
# id :uuid not null, primary key
# content :text not null
# created_at :datetime not null
# updated_at :datetime not null
# user_id :uuid not null
#
# Indexes
#
# index_posts_on_user_id (user_id)
#
# Foreign Keys
#
# fk_rails_... (user_id => users.id)
#
Command
bin/rails generate graphiti:resource Post --model=Post --rawid
Output
Could not find type :text! This was specified on attribute :content within resource PostResource (Graphiti::Errors::TypeNotFound)
Valid types are: [:integer_id, :uuid, :string_enum, :integer_enum, :string, :integer, :big_decimal, :float, :boolean, :date, :datetime, :hash, :array, :array_of_integer_ids, :array_of_uuids, :array_of_string_enums, :array_of_integer_enums, :array_of_strings, :array_of_integers, :array_of_big_decimals, :array_of_floats, :array_of_dates, :array_of_datetimes]
I think the generator should map the Rails column type to Graphiti attribute type.