class Shoulda::Matchers::Graphql::Fields::FieldMatcher

Attributes

field_name[R]

Public Class Methods

new(field_name) click to toggle source
# File lib/shoulda/matchers/graphql/fields/field_matcher.rb, line 8
def initialize(field_name)
  @field_name = field_name
  @subject = nil
end

Public Instance Methods

description() click to toggle source
# File lib/shoulda/matchers/graphql/fields/field_matcher.rb, line 13
def description
  "define field #@field_name"
end
matches?(subject) click to toggle source
# File lib/shoulda/matchers/graphql/fields/field_matcher.rb, line 17
def matches?(subject)
  @subject = subject
  self
end
of_type(type_name) click to toggle source
# File lib/shoulda/matchers/graphql/fields/field_matcher.rb, line 22
def of_type(type_name)
  OfType.new(@field_name, type_name)
end
optional() click to toggle source
# File lib/shoulda/matchers/graphql/fields/field_matcher.rb, line 26
def optional
  Optional.new(@field_name)
end
required() click to toggle source
# File lib/shoulda/matchers/graphql/fields/field_matcher.rb, line 30
def required
  Required.new(@field_name)
end
with_arguments(argument_hash) click to toggle source
# File lib/shoulda/matchers/graphql/fields/field_matcher.rb, line 38
def with_arguments(argument_hash)
  WithArguments.new(@field_name, argument_hash)
end
with_description(field_description) click to toggle source
# File lib/shoulda/matchers/graphql/fields/field_matcher.rb, line 34
def with_description(field_description)
  WithDescription.new(@field_name, field_description)
end