Sha256: 1f9748b6d3df7bb6a06b2ca6a31d86be8ecc5c457c34da2b6d5a927a371a9efd

Contents?: true

Size: 602 Bytes

Versions: 10

Compression:

Stored size: 602 Bytes

Contents

GraphQL::ID_TYPE = GraphQL::ScalarType.define do
  name "ID"
  description "Represents a unique identifier that is Base64 obfuscated. It is often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `\"VXNlci0xMA==\"`) or integer (such as `4`) input value will be accepted as an ID."

  coerce_result ->(value) { value.to_s }
  coerce_input ->(value) {
    case value
    when String, Fixnum, Bignum
      value.to_s
    else
      nil
    end
  }
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
graphql-1.2.6 lib/graphql/id_type.rb
graphql-1.2.5 lib/graphql/id_type.rb
graphql-1.2.4 lib/graphql/id_type.rb
graphql-1.2.3 lib/graphql/id_type.rb
graphql-1.2.2 lib/graphql/id_type.rb
graphql-1.2.1 lib/graphql/id_type.rb
graphql-1.2.0 lib/graphql/id_type.rb
graphql-1.1.0 lib/graphql/id_type.rb
graphql-1.0.0 lib/graphql/id_type.rb
graphql-0.19.4 lib/graphql/id_type.rb