Skip to content

Commit 0771e03

Browse files
authored
Merge pull request #1 from svtek/hotfix/connectionFixes
Hotfix/connection fixes
2 parents 7ad3bc2 + 54443b6 commit 0771e03

File tree

2 files changed

+3
-16
lines changed

2 files changed

+3
-16
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

lib/generators/graphql/templates/controllers/graph_ql_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ def execute
99
variables = params[:variables]
1010
end
1111

12-
render json: GraphQL::Query.new(RelaySchema, params[:query], variables: variables, debug: true).result
12+
render json: GraphQL::Query.new(RelaySchema, params[:query], variables: variables).result
1313
end
1414

1515
end

0 commit comments

Comments
 (0)