Sha256: 1e33a458ce13452c3817de0ef849af0af86ad0f212c467d5f764eeaf28394d4e

Contents?: true

Size: 384 Bytes

Versions: 6

Compression:

Stored size: 384 Bytes

Contents

# frozen_string_literal: true
GraphQL::STRING_TYPE = GraphQL::ScalarType.define do
  name "String"
  description "Represents textual data as UTF-8 character sequences. This type is most often used by GraphQL to represent free-form human-readable text."

  coerce_result ->(value) { value.to_s }
  coerce_input ->(value) { value.is_a?(String) ? value : nil }
  default_scalar true
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
graphql-1.4.5 lib/graphql/string_type.rb
graphql-1.4.4 lib/graphql/string_type.rb
graphql-1.4.3 lib/graphql/string_type.rb
graphql-1.4.2 lib/graphql/string_type.rb
graphql-1.4.1 lib/graphql/string_type.rb
graphql-1.4.0 lib/graphql/string_type.rb