class Graphql::Generators::UnionGenerator
Generate a union type by name with the specified member types.
“` rails g graphql:union SearchResultType ImageType AudioType “`
Public Instance Methods
create_type_file()
click to toggle source
# File lib/generators/graphql/union_generator.rb, line 21 def create_type_file template "union.erb", "#{options[:directory]}/types/#{type_file_name}.rb" end
Private Instance Methods
normalized_possible_types()
click to toggle source
# File lib/generators/graphql/union_generator.rb, line 27 def normalized_possible_types possible_types.map { |t| self.class.normalize_type_expression(t, mode: :ruby)[0] } end