Sha256: a24d5bbd424a501405df6fbeb2f169a5e764948dc1cd8bb7fba4fba3686ce998

Contents?: true

Size: 1.04 KB

Versions: 68

Compression:

Stored size: 1.04 KB

Contents

# frozen_string_literal: true

module GraphQL
  class Schema
    class Member
      module TypeSystemHelpers
        # @return [Schema::NonNull] Make a non-null-type representation of this type
        def to_non_null_type
          @to_non_null_type ||= GraphQL::Schema::NonNull.new(self)
        end

        # @return [Schema::List] Make a list-type representation of this type
        def to_list_type
          @to_list_type ||= GraphQL::Schema::List.new(self)
        end

        # @return [Boolean] true if this is a non-nullable type. A nullable list of non-nullables is considered nullable.
        def non_null?
          false
        end

        # @return [Boolean] true if this is a list type. A non-nullable list is considered a list.
        def list?
          false
        end

        def to_type_signature
          graphql_name
        end

        # @return [GraphQL::TypeKinds::TypeKind]
        def kind
          raise GraphQL::RequiredImplementationMissingError, "No `.kind` defined for #{self}"
        end
      end
    end
  end
end

Version data entries

68 entries across 68 versions & 2 rubygems

Version Path
graphql-1.12.25 lib/graphql/schema/member/type_system_helpers.rb
graphql-1.13.24 lib/graphql/schema/member/type_system_helpers.rb
graphql-1.13.23 lib/graphql/schema/member/type_system_helpers.rb
graphql-1.13.22 lib/graphql/schema/member/type_system_helpers.rb
graphql-1.13.21 lib/graphql/schema/member/type_system_helpers.rb
graphql-1.13.20 lib/graphql/schema/member/type_system_helpers.rb
graphql-1.13.19 lib/graphql/schema/member/type_system_helpers.rb
graphql-1.13.18 lib/graphql/schema/member/type_system_helpers.rb
graphql-2.0.16 lib/graphql/schema/member/type_system_helpers.rb
graphql-1.13.17 lib/graphql/schema/member/type_system_helpers.rb
graphql-2.0.15 lib/graphql/schema/member/type_system_helpers.rb
graphql-2.0.14 lib/graphql/schema/member/type_system_helpers.rb
graphql-1.13.16 lib/graphql/schema/member/type_system_helpers.rb
graphql-2.0.13 lib/graphql/schema/member/type_system_helpers.rb
graphql-2.0.12 lib/graphql/schema/member/type_system_helpers.rb
graphql-1.13.15 lib/graphql/schema/member/type_system_helpers.rb
graphql-2.0.11 lib/graphql/schema/member/type_system_helpers.rb
graphql-1.13.14 lib/graphql/schema/member/type_system_helpers.rb
graphql-1.13.13 lib/graphql/schema/member/type_system_helpers.rb
graphql-2.0.9 lib/graphql/schema/member/type_system_helpers.rb