Skip to content

Commit 2433e07

Browse files
rmosolgovaclavbohac
authored andcommitted
Set comment for interfaces
1 parent 6aa0a94 commit 2433e07

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

lib/graphql/schema/interface.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ def included(child_class)
6363

6464
child_class.introspection(introspection)
6565
child_class.description(description)
66+
child_class.comment(nil)
6667
# If interfaces are mixed into each other, only define this class once
6768
if !child_class.const_defined?(:UnresolvedTypeError, false)
6869
add_unresolved_type_error(child_class)

lib/graphql/schema/member/base_dsl_methods.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,13 @@ def description(new_description = nil)
5454
# call it without an argument to get the comment
5555
# @param new_comment [String]
5656
# @return [String, nil]
57-
def comment(new_comment = nil)
58-
if new_comment
57+
def comment(new_comment = NOT_CONFIGURED)
58+
if !NOT_CONFIGURED.equal?(new_comment)
5959
@comment = new_comment
60-
elsif defined?(comment)
60+
elsif defined?(@comment)
6161
@comment
6262
else
63-
@comment = nil
63+
nil
6464
end
6565
end
6666

@@ -70,7 +70,7 @@ module ConfigurationExtension
7070
def inherited(child_class)
7171
child_class.introspection(introspection)
7272
child_class.description(description)
73-
child_class.comment(comment)
73+
child_class.comment(nil)
7474
child_class.default_graphql_name = nil
7575

7676
if defined?(@graphql_name) && @graphql_name && (self.name.nil? || graphql_name != default_graphql_name)

0 commit comments

Comments
 (0)