Sha256: 63dbc1b13c80b1b01069205302784ec25956d7b087583c0ddf64758772733887

Contents?: true

Size: 741 Bytes

Versions: 56

Compression:

Stored size: 741 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::NonNullType.new(of_type: self)
      end

      def to_list_type
        @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

56 entries across 56 versions & 2 rubygems

Version Path
graphql-1.13.23 lib/graphql/schema/late_bound_type.rb
graphql-1.13.22 lib/graphql/schema/late_bound_type.rb
graphql-1.13.21 lib/graphql/schema/late_bound_type.rb
graphql-1.13.20 lib/graphql/schema/late_bound_type.rb
graphql-1.13.19 lib/graphql/schema/late_bound_type.rb
graphql-1.13.18 lib/graphql/schema/late_bound_type.rb
graphql-1.13.17 lib/graphql/schema/late_bound_type.rb
graphql-1.13.16 lib/graphql/schema/late_bound_type.rb
graphql-1.13.15 lib/graphql/schema/late_bound_type.rb
graphql-1.13.14 lib/graphql/schema/late_bound_type.rb
graphql-1.13.13 lib/graphql/schema/late_bound_type.rb
graphql_cody-1.13.0 lib/graphql/schema/late_bound_type.rb
graphql-1.13.12 lib/graphql/schema/late_bound_type.rb
graphql-1.13.11 lib/graphql/schema/late_bound_type.rb
graphql-1.13.10 lib/graphql/schema/late_bound_type.rb
graphql-1.13.9 lib/graphql/schema/late_bound_type.rb
graphql-1.12.24 lib/graphql/schema/late_bound_type.rb
graphql-1.13.8 lib/graphql/schema/late_bound_type.rb
graphql-1.13.7 lib/graphql/schema/late_bound_type.rb
graphql-1.13.6 lib/graphql/schema/late_bound_type.rb