Skip to content

Commit 5ded9ba

Browse files
authored
Merge pull request #28 from rmosolgo/fix-possible-types
Transform possible_types to use names
2 parents 1eee9d2 + 680c9ed commit 5ded9ba

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/graphql/client.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,11 @@ def initialize(schema:, execute: nil, enforce_collocated_callers: false, raise_o
100100
@enforce_collocated_callers = enforce_collocated_callers
101101
if schema.is_a?(Class)
102102
@possible_types = schema.possible_types
103+
key, _types = @possible_types.first
104+
# GraphQL-Ruby 2.3.5+ has classes here instead of strings
105+
if key.is_a?(Module)
106+
@possible_types = @possible_types.transform_keys(&:graphql_name)
107+
end
103108
end
104109
@types = Schema.generate(@schema, raise_on_unknown_enum_value: raise_on_unknown_enum_value)
105110
end

0 commit comments

Comments
 (0)