Sha256: eaaa6cf48c64eb4a87e185ab1f270a43721632527f3905c5c185d241aa5dbbc3

Contents?: true

Size: 701 Bytes

Versions: 23

Compression:

Stored size: 701 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
        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

23 entries across 23 versions & 1 rubygems

Version Path
graphql-1.11.4 lib/graphql/schema/late_bound_type.rb
graphql-1.11.3 lib/graphql/schema/late_bound_type.rb
graphql-1.11.2 lib/graphql/schema/late_bound_type.rb
graphql-1.10.14 lib/graphql/schema/late_bound_type.rb
graphql-1.11.1 lib/graphql/schema/late_bound_type.rb
graphql-1.10.13 lib/graphql/schema/late_bound_type.rb
graphql-1.11.0 lib/graphql/schema/late_bound_type.rb
graphql-1.10.12 lib/graphql/schema/late_bound_type.rb
graphql-1.10.11 lib/graphql/schema/late_bound_type.rb
graphql-1.10.10 lib/graphql/schema/late_bound_type.rb
graphql-1.10.9 lib/graphql/schema/late_bound_type.rb
graphql-1.10.8 lib/graphql/schema/late_bound_type.rb
graphql-1.10.7 lib/graphql/schema/late_bound_type.rb
graphql-1.10.6 lib/graphql/schema/late_bound_type.rb
graphql-1.10.5 lib/graphql/schema/late_bound_type.rb
graphql-1.10.4 lib/graphql/schema/late_bound_type.rb
graphql-1.10.3 lib/graphql/schema/late_bound_type.rb
graphql-1.10.2 lib/graphql/schema/late_bound_type.rb
graphql-1.10.1 lib/graphql/schema/late_bound_type.rb
graphql-1.10.0 lib/graphql/schema/late_bound_type.rb