Sha256: 8bc2504c85b13b2158a7344857b30be6f03a7e5f87aa77068810677cb61c47ab

Contents?: true

Size: 669 Bytes

Versions: 55

Compression:

Stored size: 669 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
      def initialize(local_name)
        @name = local_name
      end

      def unwrap
        self
      end

      def to_non_null_type
        GraphQL::NonNullType.new(of_type: self)
      end

      def to_list_type
        GraphQL::ListType.new(of_type: self)
      end

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

      alias :to_s :inspect
    end
  end
end

Version data entries

55 entries across 55 versions & 1 rubygems

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