Sha256: 0b93313bf08be1816604477ce2e3b6c607f9f68d49ef3a2fa086dd3ef3da3042

Contents?: true

Size: 731 Bytes

Versions: 13

Compression:

Stored size: 731 Bytes

Contents

# frozen_string_literal: true
module GraphQL
  class Schema
    # A stand-in for a type which will be resolved in a given schema, by name.
    # TODO: support argument types too, make this a public API somehow
    # @api Private
    class LateBoundType
      attr_reader :name
      alias :graphql_name :name
      def initialize(local_name)
        @name = local_name
      end

      def unwrap
        self
      end

      def to_non_null_type
        @to_non_null_type ||= GraphQL::Schema::NonNull.new(self)
      end

      def to_list_type
        @to_list_type ||= GraphQL::Schema::List.new(self)
      end

      def inspect
        "#<LateBoundType @name=#{name}>"
      end

      alias :to_s :inspect
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
graphql-2.0.13 lib/graphql/schema/late_bound_type.rb
graphql-2.0.12 lib/graphql/schema/late_bound_type.rb
graphql-2.0.11 lib/graphql/schema/late_bound_type.rb
graphql-2.0.9 lib/graphql/schema/late_bound_type.rb
graphql-2.0.8 lib/graphql/schema/late_bound_type.rb
graphql-2.0.7 lib/graphql/schema/late_bound_type.rb
graphql-2.0.6 lib/graphql/schema/late_bound_type.rb
graphql-2.0.5 lib/graphql/schema/late_bound_type.rb
graphql-2.0.4 lib/graphql/schema/late_bound_type.rb
graphql-2.0.3 lib/graphql/schema/late_bound_type.rb
graphql-2.0.2 lib/graphql/schema/late_bound_type.rb
graphql-2.0.1 lib/graphql/schema/late_bound_type.rb
graphql-2.0.0 lib/graphql/schema/late_bound_type.rb