Sha256: 4a5004c67fc9e0460260815235c6e41d75391805615361c0426f6fb42c67b422

Contents?: true

Size: 783 Bytes

Versions: 11

Compression:

Stored size: 783 Bytes

Contents

# Some conveniences for definining return & argument types.
#
# Passed into initialization blocks, eg {ObjectType#initialize}, {Field#initialize}
class GraphQL::DefinitionHelpers::TypeDefiner
  include Singleton

  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

  # 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

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
graphql-0.11.0 lib/graphql/definition_helpers/type_definer.rb
graphql-0.10.9 lib/graphql/definition_helpers/type_definer.rb
graphql-0.10.8 lib/graphql/definition_helpers/type_definer.rb
graphql-0.10.7 lib/graphql/definition_helpers/type_definer.rb
graphql-0.10.6 lib/graphql/definition_helpers/type_definer.rb
graphql-0.10.5 lib/graphql/definition_helpers/type_definer.rb
graphql-0.10.4 lib/graphql/definition_helpers/type_definer.rb
graphql-0.10.3 lib/graphql/definition_helpers/type_definer.rb
graphql-0.10.2 lib/graphql/definition_helpers/type_definer.rb
graphql-0.10.1 lib/graphql/definition_helpers/type_definer.rb
graphql-0.10.0 lib/graphql/definition_helpers/type_definer.rb