Sha256: da0aaf6ddd239644f67a950fc74b176da03c2cfc4c0e1a1b42f35b57f60bb2dc

Contents?: true

Size: 1000 Bytes

Versions: 97

Compression:

Stored size: 1000 Bytes

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::INT_TYPE;      end
      def String;   GraphQL::STRING_TYPE;   end
      def Float;    GraphQL::FLOAT_TYPE;    end
      def Boolean;  GraphQL::BOOLEAN_TYPE;  end
      def ID;       GraphQL::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

97 entries across 97 versions & 1 rubygems

Version Path
graphql-1.11.10 lib/graphql/define/type_definer.rb
graphql-1.11.9 lib/graphql/define/type_definer.rb
graphql-1.11.8 lib/graphql/define/type_definer.rb
graphql-1.11.7 lib/graphql/define/type_definer.rb
graphql-1.11.6 lib/graphql/define/type_definer.rb
graphql-1.8.18 lib/graphql/define/type_definer.rb
graphql-1.11.5 lib/graphql/define/type_definer.rb
graphql-1.11.4 lib/graphql/define/type_definer.rb
graphql-1.11.3 lib/graphql/define/type_definer.rb
graphql-1.11.2 lib/graphql/define/type_definer.rb
graphql-1.10.14 lib/graphql/define/type_definer.rb
graphql-1.11.1 lib/graphql/define/type_definer.rb
graphql-1.10.13 lib/graphql/define/type_definer.rb
graphql-1.11.0 lib/graphql/define/type_definer.rb
graphql-1.10.12 lib/graphql/define/type_definer.rb
graphql-1.9.21 lib/graphql/define/type_definer.rb
graphql-1.10.11 lib/graphql/define/type_definer.rb
graphql-1.9.20 lib/graphql/define/type_definer.rb
graphql-1.10.10 lib/graphql/define/type_definer.rb
graphql-1.10.9 lib/graphql/define/type_definer.rb