Open OlegSavinov opened 2 years ago
Hi! Can you call .to_h on the Types::Inputs::MeetingSettingsInputType instance? I guess it will help
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
We cannot add any possible class to the case statement inside one.rb
🤔 Looks like we need some way to configure these casts on the app level
...or maybe we could check if object has .to_h
and just assume that it's something that could become a Hash
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)
The set up is as follows
Child class
Parent class
The error, when model creates caused by:
StoreModel::Types::CastError:
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!