Skip to content

Commit 75a69c0

Browse files
committed
connectionTypeFixes
1 parent 7ad3bc2 commit 75a69c0

File tree

1 file changed

+2
-15
lines changed

1 file changed

+2
-15
lines changed

lib/generators/graphql/graphql_helpers.rb

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,7 @@ def add_methods(model)
5757

5858
begin
5959
if models.include? association_klass.classify.constantize
60-
if circular_finder[model.to_s].include? association_klass || association_klass == model.to_s
61-
inject_into_file type_path(model), before: "# End of fields\n" do <<-FILE
60+
inject_into_file type_path(model), before: "# End of fields\n" do <<-FILE
6261
field :#{ast.to_s} do
6362
type -> { #{model.reflect_on_association(ast).class_name}Type }
6463
@@ -67,19 +66,7 @@ def add_methods(model)
6766
}
6867
end
6968
70-
FILE
71-
end
72-
else
73-
inject_into_file type_path(model), before: "# End of fields\n" do <<-FILE
74-
field :#{ast.to_s} do
75-
type -> #{model.reflect_on_association(ast).class_name}Type
76-
77-
resolve -> (#{singular_route_key(model)}, args, ctx) {
78-
#{singular_route_key(model)}.#{ast.to_s}
79-
}
80-
end
81-
FILE
82-
end
69+
FILE
8370
end
8471
end
8572
rescue => ex

0 commit comments

Comments
 (0)