diff options
Diffstat (limited to 'app/graphql/types/global_id_type.rb')
-rw-r--r-- | app/graphql/types/global_id_type.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/app/graphql/types/global_id_type.rb b/app/graphql/types/global_id_type.rb index ed28c3ffd7e..007d86f60b8 100644 --- a/app/graphql/types/global_id_type.rb +++ b/app/graphql/types/global_id_type.rb @@ -67,7 +67,10 @@ module Types end self.define_singleton_method(:suitable?) do |gid| - gid&.model_class&.ancestors&.include?(model_class) + next false if gid.nil? + + gid.model_name.safe_constantize.present? && + gid.model_class.ancestors.include?(model_class) end self.define_singleton_method(:coerce_input) do |string, ctx| |