Sha256: aa87b545bd4006b3fee33be0f315c82f50146a50391dfc0fbe8cbe16a3b2874e

Contents?: true

Size: 1.03 KB

Versions: 49

Compression:

Stored size: 1.03 KB

Contents

# frozen_string_literal: true
module GraphQL
  module Define
    # Some conveniences for definining return & argument types.
    #
    # Passed into initialization blocks, eg {ObjectType#initialize}, {Field#initialize}
    class TypeDefiner
      include Singleton
      # rubocop:disable Naming/MethodName
      def Int;      GraphQL::DEPRECATED_INT_TYPE;      end
      def String;   GraphQL::DEPRECATED_STRING_TYPE;   end
      def Float;    GraphQL::DEPRECATED_FLOAT_TYPE;    end
      def Boolean;  GraphQL::DEPRECATED_BOOLEAN_TYPE;  end
      def ID;       GraphQL::DEPRECATED_ID_TYPE;       end
      # rubocop:enable Naming/MethodName

      # Make a {ListType} which wraps the input type
      #
      # @example making a list type
      #   list_of_strings = types[types.String]
      #   list_of_strings.inspect
      #   # => "[String]"
      #
      # @param type [Type] A type to be wrapped in a ListType
      # @return [GraphQL::ListType] A ListType wrapping `type`
      def [](type)
        type.to_list_type
      end
    end
  end
end

Version data entries

49 entries across 49 versions & 2 rubygems

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