lib/graphql/schema/object.rb in graphql-1.10.10 vs lib/graphql/schema/object.rb in graphql-1.10.11
- old
+ new
@@ -69,9 +69,16 @@
@object = object
@context = context
end
class << self
+ # Set up a type-specific invalid null error to use when this object's non-null fields wrongly return `nil`.
+ # It should help with debugging and bug tracker integrations.
+ def inherited(child_class)
+ child_class.const_set(:InvalidNullError, Class.new(GraphQL::InvalidNullError))
+ super
+ end
+
def implements(*new_interfaces, **options)
new_memberships = []
new_interfaces.each do |int|
if int.is_a?(Module)
unless int.include?(GraphQL::Schema::Interface)