Skip to content

Commit ef3d6f8

Browse files
author
Robert Mosolgo
authored
Merge pull request rmosolgo#1756 from RobertWSaunders/move-error-to-default-graphql-name
Move NotImplementedError out to default_graphql_name
2 parents fbde4cb + 4884a10 commit ef3d6f8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/graphql/schema/member/base_dsl_methods.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ def graphql_name(new_name = nil)
2020
when overridden = overridden_graphql_name
2121
overridden
2222
else
23-
raise NotImplementedError, 'Anonymous class should declare a `graphql_name`' if name.nil?
24-
2523
default_graphql_name
2624
end
2725
end
@@ -81,6 +79,8 @@ def overridden_graphql_name
8179
# The default name is the Ruby constant name,
8280
# without any namespaces and with any `-Type` suffix removed
8381
def default_graphql_name
82+
raise NotImplementedError, 'Anonymous class should declare a `graphql_name`' if name.nil?
83+
8484
name.split("::").last.sub(/Type\Z/, "")
8585
end
8686

0 commit comments

Comments
 (0)