We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents fbde4cb + 4884a10 commit ef3d6f8Copy full SHA for ef3d6f8
lib/graphql/schema/member/base_dsl_methods.rb
@@ -20,8 +20,6 @@ def graphql_name(new_name = nil)
20
when overridden = overridden_graphql_name
21
overridden
22
else
23
- raise NotImplementedError, 'Anonymous class should declare a `graphql_name`' if name.nil?
24
-
25
default_graphql_name
26
end
27
@@ -81,6 +79,8 @@ def overridden_graphql_name
81
79
# The default name is the Ruby constant name,
82
80
# without any namespaces and with any `-Type` suffix removed
83
def default_graphql_name
+ raise NotImplementedError, 'Anonymous class should declare a `graphql_name`' if name.nil?
+
84
name.split("::").last.sub(/Type\Z/, "")
85
86
0 commit comments