Class: Graphql::Generators::InterfaceGenerator

Inherits:
TypeGeneratorBase
  • Object
show all
Defined in:
lib/generators/graphql/interface_generator.rb

Overview

Generate an interface type by name, with the specified fields.

rails g graphql:interface NamedEntityType name:String!

Instance Method Summary collapse

Methods inherited from TypeGeneratorBase

normalize_type_expression

Methods included from Core

#create_dir, #create_mutation_root_type, #insert_root_type, #module_namespacing_when_supported, #schema_file_path

Instance Method Details

#create_type_fileObject



22
23
24
# File 'lib/generators/graphql/interface_generator.rb', line 22

def create_type_file
  template "interface.erb", "#{options[:directory]}/types/#{type_file_name}.rb"
end