rails-graphql 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5b7143f1fc49071fc54b85e984ef9289158ca63f5609e205e06922a176409dbe
4
- data.tar.gz: 3decb2c2d664b54910810970502e8964ce38e150e0b2d77a4828f341b28ea86d
3
+ metadata.gz: cdf2022ac5afdaa3bc0f3068625508c47d5f2df97325427f214f79030f72778b
4
+ data.tar.gz: 0176fe930c8a991f98c2ad28afb2ebce462fc4a64ad9565fffd8fd29e5ca9019
5
5
  SHA512:
6
- metadata.gz: b9726c20a23e8960aed07f6756f83e5bc195d87af453e60509b0f8414ff7395281a7fd85f9f5bf487668f03474d273a51a5a1601ac40f5f521c6ce05ff770a94
7
- data.tar.gz: b36323d14417f0e153690b3f4c436fd8254c83982e1b379b618ae7666c72c8d6ace2177e3d24821d8e2345db39a823a402d6a588506277ce4a7e4c712300c4a9
6
+ metadata.gz: 0fc23bb1c616165efbdb46ee04697308245a63f6345418dfb5e972d99543c527abcd18cd926786bc9f8de444a39fda60791e1570c4f60b096a0dea501c7bfaeb
7
+ data.tar.gz: f09ed8ccfb57024a3334589ce1f609efb29eef330f1af235a47d232b881953472e9b2c25190e3b6b3cefbc4927ae1fef841d171dc82d1e2156874b70c5ea3588
@@ -55,7 +55,17 @@ module Rails # :nodoc:
55
55
 
56
56
  # Return the default value if the given +value+ is nil
57
57
  def deserialize(value = nil)
58
- value.nil? ? @default : super
58
+ value.nil? ? default : super
59
+ end
60
+
61
+ # A little override to use the default value
62
+ def to_json(value = nil)
63
+ super(value.nil? ? default : value)
64
+ end
65
+
66
+ # A little override to use the default value
67
+ def as_json(value = nil)
68
+ super(value.nil? ? default : value)
59
69
  end
60
70
 
61
71
  # Checks if the default value of the field is valid
@@ -77,7 +77,7 @@ module Rails # :nodoc:
77
77
  # Get the GraphQL variables for a request
78
78
  def gql_variables(variables = params[:variables])
79
79
  case variables
80
- when ::ActionController::Parameters then variables.permit!
80
+ when ::ActionController::Parameters then variables.permit!.to_h
81
81
  when String then variables.present? ? JSON.parse(variables) : {}
82
82
  when Hash then variables
83
83
  else {}
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Rails # :nodoc:
4
4
  module GraphQL # :nodoc:
5
- VERSION = '0.1.2'
5
+ VERSION = '0.1.3'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-graphql
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Carlos Silva
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-12-18 00:00:00.000000000 Z
11
+ date: 2020-12-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails