class GraphQL::Client::Schema::InterfaceType
Public Class Methods
new(type)
click to toggle source
# File lib/graphql/client/schema/interface_type.rb, line 11 def initialize(type) unless type.kind.interface? raise "expected type to be an Interface, but was #{type.class}" end @type = type end
Public Instance Methods
define_class(definition, ast_nodes)
click to toggle source
# File lib/graphql/client/schema/interface_type.rb, line 23 def define_class(definition, ast_nodes) possible_type_names = definition.client.schema.possible_types(type).map(&:graphql_name) possible_types = possible_type_names.map { |concrete_type_name| schema_module.get_class(concrete_type_name).define_class(definition, ast_nodes) } new(possible_types) end
new(types)
click to toggle source
# File lib/graphql/client/schema/interface_type.rb, line 19 def new(types) PossibleTypes.new(type, types) end