Class: Dry::GraphQL::Types::JSON

Inherits:
GraphQL::Schema::Scalar
  • Object
show all
Defined in:
lib/dry/graphql/types.rb

Overview

JSON type, needed for Dry::Types::Hash currently

Class Method Summary collapse

Class Method Details

.coerce_input(str, _ctx) ⇒ Object



10
11
12
# File 'lib/dry/graphql/types.rb', line 10

def self.coerce_input(str, _ctx)
  JSON.parse(str)
end

.coerce_result(obj, _ctx) ⇒ Object



14
15
16
# File 'lib/dry/graphql/types.rb', line 14

def self.coerce_result(obj, _ctx)
  JSON.dump(obj)
end