spec/support/star_wars_schema.rb in graphql-relay-0.9.1 vs spec/support/star_wars_schema.rb in graphql-relay-0.9.2
- old
+ new
@@ -19,11 +19,15 @@
type_from_object -> (object) do
if object == :test_error
:not_a_type
elsif object.is_a?(Base)
BaseType
+ elsif STAR_WARS_DATA["Faction"].values.include?(object)
+ Faction
+ elsif STAR_WARS_DATA["Ship"].values.include?(object)
+ Ship
else
- STAR_WARS_DATA["Faction"].values.include?(object) ? Faction : Ship
+ nil
end
end
end
Ship = GraphQL::ObjectType.define do