Method: GraphQL::Schema::Warden#possible_types

Defined in:
lib/graphql/schema/warden.rb

#possible_types(type_defn) ⇒ Array<GraphQL::BaseType>

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns The types which may be member of type_defn.

Returns:

  • (Array<GraphQL::BaseType>)

    The types which may be member of type_defn



301
302
303
304
305
306
307
# File 'lib/graphql/schema/warden.rb', line 301

def possible_types(type_defn)
  @visible_possible_types ||= read_through { |type_defn|
    pt = @schema.possible_types(type_defn, @context, false)
    pt.select { |t| visible_and_reachable_type?(t) }
  }
  @visible_possible_types[type_defn]
end