Sha256: fb9ccf413aa98079d65081ce2bf76d9d771ec44a8fc5e66abc9b01cc4ea63d9d

Contents?: true

Size: 888 Bytes

Versions: 33

Compression:

Stored size: 888 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
        @to_non_null_type = nil
        @to_list_type = nil
      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 to_type_signature
        name
      end

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

      def non_null?
        false
      end

      alias :to_s :inspect
    end
  end
end

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
graphql-2.4.14 lib/graphql/schema/late_bound_type.rb
graphql-2.3.22 lib/graphql/schema/late_bound_type.rb
graphql-2.3.21 lib/graphql/schema/late_bound_type.rb
graphql-2.4.13 lib/graphql/schema/late_bound_type.rb
graphql-2.4.12 lib/graphql/schema/late_bound_type.rb
graphql-2.4.11 lib/graphql/schema/late_bound_type.rb
graphql-2.4.10 lib/graphql/schema/late_bound_type.rb
graphql-2.4.9 lib/graphql/schema/late_bound_type.rb
graphql-2.4.8 lib/graphql/schema/late_bound_type.rb
graphql-2.4.7 lib/graphql/schema/late_bound_type.rb
graphql-2.4.6 lib/graphql/schema/late_bound_type.rb
graphql-2.4.5 lib/graphql/schema/late_bound_type.rb
graphql-2.4.4 lib/graphql/schema/late_bound_type.rb
graphql-2.4.3 lib/graphql/schema/late_bound_type.rb
graphql-2.4.2 lib/graphql/schema/late_bound_type.rb
graphql-2.4.1 lib/graphql/schema/late_bound_type.rb
graphql-2.4.0 lib/graphql/schema/late_bound_type.rb
graphql-2.3.20 lib/graphql/schema/late_bound_type.rb
graphql-2.3.19 lib/graphql/schema/late_bound_type.rb
graphql-2.3.18 lib/graphql/schema/late_bound_type.rb