You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi! Thank you for a really cool gem first of all.
The issue raises when the model get Input type from GraphQL mutation and Rails defines it as an instance of a different from Model or JSON type (in my case Types::Inputs::MeetingSettingsInputType)
class MeetingSettings
include StoreModel::Model
attribute :visitor_access, :boolean
attribute :host_launch, :boolean
attribute :users_access, :boolean
attribute :join_request, :boolean
end
Parent class
class Meeting < ApplicationRecord
attribute :settings, MeetingSettings.to_type
end
The error, when model creates caused by:
# StoreModel::Types::CastError:
# failed casting #<Types::Inputs::MeetingSettingsInputType: .... > only String, Hash or MeetingSettings instances are allowed
By the source code I defined that lib/store_model/types/one.rb:35:in `cast_value' won't try to cast it and raises error.
I guess the resolving will be useful and will make the StoreModel a perfect solution for GraphQL purposes also!
The text was updated successfully, but these errors were encountered:
Thats what I did, and it helped. Though I could not catch this param in any callbacks, so it needs to be tracked throughout the project and it not very good
Hi! Thank you for a really cool gem first of all.
The issue raises when the model get Input type from GraphQL mutation and Rails defines it as an instance of a different from Model or JSON type (in my case Types::Inputs::MeetingSettingsInputType)
The set up is as follows
Child class
Parent class
The error, when model creates caused by:
# StoreModel::Types::CastError:
# failed casting #<Types::Inputs::MeetingSettingsInputType: .... > only String, Hash or MeetingSettings instances are allowed
By the source code I defined that lib/store_model/types/one.rb:35:in `cast_value' won't try to cast it and raises error.
I guess the resolving will be useful and will make the StoreModel a perfect solution for GraphQL purposes also!
The text was updated successfully, but these errors were encountered: