Sha256: 0f515c563720168e8ebaeeba417ddc8fd6fb6a92a588ba6d49b219130fe977e8

Contents?: true

Size: 832 Bytes

Versions: 27

Compression:

Stored size: 832 Bytes

Contents

# frozen_string_literal: true

module GraphQL
  class Schema
    # Represents a non null type in the schema.
    # Wraps a {Schema::Member} when it is required.
    # @see {Schema::Member::TypeSystemHelpers#to_non_null_type}
    class NonNull < GraphQL::Schema::Wrapper
      def to_graphql
        @of_type.graphql_definition.to_non_null_type
      end

       # @return [GraphQL::TypeKinds::NON_NULL]
      def kind
        GraphQL::TypeKinds::NON_NULL
      end

      # @return [true]
      def non_null?
        true
      end

      # @return [Boolean] True if this type wraps a list type
      def list?
        @of_type.list?
      end

      def to_type_signature
        "#{@of_type.to_type_signature}!"
      end

      def inspect
        "#<#{self.class.name} @of_type=#{@of_type.inspect}>"
      end
    end
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
graphql-1.9.21 lib/graphql/schema/non_null.rb
graphql-1.9.20 lib/graphql/schema/non_null.rb
graphql-1.9.19 lib/graphql/schema/non_null.rb
graphql-1.9.18 lib/graphql/schema/non_null.rb
graphql-1.9.17 lib/graphql/schema/non_null.rb
graphql-1.9.16 lib/graphql/schema/non_null.rb
graphql-1.9.15 lib/graphql/schema/non_null.rb
graphql-1.9.14 lib/graphql/schema/non_null.rb
graphql-1.10.0.pre1 lib/graphql/schema/non_null.rb
graphql-1.9.13 lib/graphql/schema/non_null.rb
graphql-1.9.12 lib/graphql/schema/non_null.rb
graphql-1.9.11 lib/graphql/schema/non_null.rb
graphql-1.9.10 lib/graphql/schema/non_null.rb
graphql-1.9.9 lib/graphql/schema/non_null.rb
graphql-1.9.8 lib/graphql/schema/non_null.rb
graphql-1.9.7 lib/graphql/schema/non_null.rb
graphql-1.9.6 lib/graphql/schema/non_null.rb
graphql-1.9.5 lib/graphql/schema/non_null.rb
graphql-1.9.4 lib/graphql/schema/non_null.rb
graphql-1.9.3 lib/graphql/schema/non_null.rb