Sha256: 75eca5479e2743cc8d57ef47042174401cf51d74d1a621777ba1ea3c27c21218

Contents?: true

Size: 802 Bytes

Versions: 13

Compression:

Stored size: 802 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)
    GraphQL::ListType.new(of_type: type)
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
graphql-0.9.5 lib/graphql/definition_helpers/type_definer.rb
graphql-0.9.4 lib/graphql/definition_helpers/type_definer.rb
graphql-0.9.3 lib/graphql/definition_helpers/type_definer.rb
graphql-0.9.2 lib/graphql/definition_helpers/type_definer.rb
graphql-0.8.1 lib/graphql/definition_helpers/type_definer.rb
graphql-0.8.0 lib/graphql/definition_helpers/type_definer.rb
graphql-0.7.1 lib/graphql/definition_helpers/type_definer.rb
graphql-0.7.0 lib/graphql/definition_helpers/type_definer.rb
graphql-0.6.2 lib/graphql/definition_helpers/type_definer.rb
graphql-0.6.1 lib/graphql/definition_helpers/type_definer.rb
graphql-0.6.0 lib/graphql/definition_helpers/type_definer.rb
graphql-0.5.0 lib/graph_ql/definition_helpers/type_definer.rb
graphql-0.4.0 lib/graph_ql/definition_helpers/type_definer.rb