Sha256: 3c073d1c3bef1cdb9e9cf1ffb57bc9776d4fa253c4e9e7c2f588a13972524535

Contents?: true

Size: 398 Bytes

Versions: 5

Compression:

Stored size: 398 Bytes

Contents

# A non-null type wraps another type.
#
# Get the underlying type with {#unwrap}
class GraphQL::NonNullType < GraphQL::BaseType
  include GraphQL::BaseType::ModifiesAnotherType

  attr_reader :of_type
  def initialize(of_type:)
    @of_type = of_type
  end

  def name
    "Non-Null"
  end

  def coerce(value)
    of_type.coerce(value)
  end

  def kind
    GraphQL::TypeKinds::NON_NULL
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
graphql-0.9.4 lib/graphql/non_null_type.rb
graphql-0.9.3 lib/graphql/non_null_type.rb
graphql-0.9.2 lib/graphql/non_null_type.rb
graphql-0.8.1 lib/graphql/non_null_type.rb
graphql-0.8.0 lib/graphql/non_null_type.rb