Sha256: fab400acc57e6530351e0489ef21bf20fe6235e8f15ba26651a2d6afa9fd2bd4

Contents?: true

Size: 748 Bytes

Versions: 12

Compression:

Stored size: 748 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
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
graphql-1.8.18 lib/graphql/schema/non_null.rb
graphql-1.8.17 lib/graphql/schema/non_null.rb
graphql-1.8.16 lib/graphql/schema/non_null.rb
graphql-1.8.15 lib/graphql/schema/non_null.rb
graphql-1.8.14 lib/graphql/schema/non_null.rb
graphql-1.8.13 lib/graphql/schema/non_null.rb
graphql-1.8.12 lib/graphql/schema/non_null.rb
graphql-1.8.11 lib/graphql/schema/non_null.rb
graphql-1.8.10 lib/graphql/schema/non_null.rb
graphql-1.8.9 lib/graphql/schema/non_null.rb
graphql-1.8.8 lib/graphql/schema/non_null.rb
graphql-1.8.7 lib/graphql/schema/non_null.rb