From 680c9ed2b30446b89a92030d95177e1db731ed8e Mon Sep 17 00:00:00 2001 From: Robert Mosolgo Date: Fri, 14 Jun 2024 15:20:14 -0400 Subject: [PATCH] Transform possible_types to use names --- lib/graphql/client.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/graphql/client.rb b/lib/graphql/client.rb index ee5eddf..f064ca2 100644 --- a/lib/graphql/client.rb +++ b/lib/graphql/client.rb @@ -100,6 +100,11 @@ def initialize(schema:, execute: nil, enforce_collocated_callers: false, raise_o @enforce_collocated_callers = enforce_collocated_callers if schema.is_a?(Class) @possible_types = schema.possible_types + key, _types = @possible_types.first + # GraphQL-Ruby 2.3.5+ has classes here instead of strings + if key.is_a?(Module) + @possible_types = @possible_types.transform_keys(&:graphql_name) + end end @types = Schema.generate(@schema, raise_on_unknown_enum_value: raise_on_unknown_enum_value) end