class Graphql::Generators::TypeGeneratorBase::NormalizedField

Public Class Methods

new(name, type_expr, null) click to toggle source
# File lib/generators/graphql/type_generator.rb, line 119
def initialize(name, type_expr, null)
  @name = name
  @type_expr = type_expr
  @null = null
end

Public Instance Methods

to_input_argument() click to toggle source
# File lib/generators/graphql/type_generator.rb, line 129
def to_input_argument
  "argument :#{@name}, #{@type_expr}, required: false"
end
to_object_field() click to toggle source
# File lib/generators/graphql/type_generator.rb, line 125
def to_object_field
  "field :#{@name}, #{@type_expr}#{@null ? '' : ', null: false'}"
end