Skip to content

Commit 4d9d797

Browse files
committed
Add test for addition fix
1 parent c0c621a commit 4d9d797

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# frozen_string_literal: true
2+
require "spec_helper"
3+
4+
describe GraphQL::Schema::Addition do
5+
it "handles duplicate types with cycles" do
6+
duplicate_types_schema = Class.new(GraphQL::Schema)
7+
duplicate_types = 2.times.map {
8+
Class.new(GraphQL::Schema::Object) do
9+
graphql_name "Thing"
10+
field :thing, self
11+
end
12+
}
13+
duplicate_types_schema.orphan_types(duplicate_types)
14+
assert_equal 2, duplicate_types_schema.send(:own_types)["Thing"].size
15+
end
16+
end

0 commit comments

Comments
 (0)